水题
文章平均质量分 82
水题
浪漫些许潦草
这个作者很懒,什么都没留下…
展开
-
hdu 2082 找单词(模拟)
找单词Problem Description假设有x1个字母A, x2个字母B,….. x26个字母Z,同时假设字母A的价值为1,字母B的价值为2,….. 字母Z的价值为26。那么,对于给定的字母,可以找到多少价值<=50的单词呢?单词的价值就是组成一个单词的所有字母的价值之和,比如,单词ACM的价值是1+3+14=18,单词HDU的价值是8+4+21=33。(组成的单词与排列顺序无关,比如ACM与原创 2017-10-16 19:34:37 · 410 阅读 · 0 评论 -
nyoj 1277 Decimal integer conversion(水题)
Decimal integer conversion描述 XiaoMing likes mathematics, and he is just learning how to convert numbers between different bases , but he keeps making errors since he is only 6 years old. Whenever Xiao原创 2017-04-14 19:58:07 · 480 阅读 · 0 评论 -
FZU Number lengths(数学)
Number lengthsProblem DescriptionN! (N factorial) can be quite irritating and difficult to compute for large values of N. So instead of calculating N!, I want to know how many digits are in it. (Rememb原创 2017-03-24 06:46:55 · 676 阅读 · 0 评论 -
NBUT 1223 Friends number(打表)
Friends number问题描述 Paula and Tai are couple. There are many stories between them. The day Paula left by airplane, Tai send one message to telephone 2200284, then, everything is changing… (The story in原创 2017-04-10 12:56:33 · 525 阅读 · 0 评论 -
FZU 1062 洗牌问题(打表找规律)
洗牌问题Problem Description设2n张牌分别标记为1, 2, …, n, n+1, …, 2n,初始时这2n张牌按其标号从小到大排列。经一次洗牌后,原来的排列顺序变成n+1, 1, n+2, 2, …, 2n, n。即前n张牌被放到偶数位置2, 4, …, 2n,而后n张牌被放到奇数位置1, 3, …, 2n-1。可以证明对于任何一个自然数n,经过若干次洗牌后可恢复初始状态。现在你的原创 2017-03-24 07:36:14 · 660 阅读 · 0 评论 -
Codeforces 792B Counting-out Rhyme
Counting-out Rhymen children are standing in a circle and playing the counting-out game. Children are numbered clockwise from 1 to n. In the beginning, the first child is considered the leader. The gam原创 2017-03-28 14:33:08 · 682 阅读 · 0 评论 -
ZOJ 3713 In 7-bit(进制转换)
题意:给一个字符串,先输出它的长度,但是长度要先用二进制表示出来,二进制的低7位左边如果没有1了,就直接将这7位二进制转化成16进制输出,如果左边还有1,就把这个低7位变成8位,最高的那位是1,然后把这个8位二进制转化成16进制输出,然后长度右移7位,重复这个操作。比如说长度是1 001 000 001(2) = 577(10) ,先输出低7位1000 001 的16进制表示形式,但是因为这个低7位原创 2017-04-07 18:48:27 · 525 阅读 · 0 评论 -
hdu 1296 Polynomial Problem(模拟)
Polynomial ProblemProblem Description We have learned how to obtain the value of a polynomial when we were a middle school student. If f(x) is a polynomial of degree n, we can letIf we have x, we can原创 2017-03-29 06:46:06 · 664 阅读 · 0 评论 -
ZOJ 3710 Friends(枚举)
FriendsAlice lives in the country where people like to make friends. The friendship is bidirectional and if any two person have no less than k friends in common, they will become friends in several day原创 2017-04-07 07:55:26 · 548 阅读 · 0 评论 -
hdu 改革春风吹满地
改革春风吹满地Crawling in process...Crawling failedDescriptionInputOutputSample InputSample OutputHintDescription“ 改革春风吹满地, 不会AC没关系;原创 2016-10-25 08:36:12 · 967 阅读 · 0 评论 -
CodeForces - 58B Coins(数论)
CoinsIn Berland a money reform is being prepared. New coins are being introduced. After long economic calculations was decided that the most expensive coin should possess the denomination of原创 2017-03-15 21:21:28 · 1006 阅读 · 0 评论 -
hdu 整除的尾数
整除的尾数Problem Description一个整数,只知道前几位,不知道末二位,被另一个整数除尽了,那么该数的末二位该是什么呢? Input输入数据有若干组,每组数据包含二个整数a,b(0 Output对应每组数据,将满足条件的所有尾数在一行内输出,格式见样本输出。同组数据的输出,其每个尾数之间空一格,行末没有空格。 Sample In原创 2016-11-20 10:36:05 · 441 阅读 · 0 评论 -
hdu 折线分割平面
折线分割平面Description我们看到过很多直线分割平面的题目,今天的这个题目稍微有些变化,我们要求的是n条折线分割平面的最大数目。比如,一条折线可以将平面分成两部分,两条折线最多可以将平面分成7部分,具体如下所示。Input输入数据的第一行是一个整数C,表示测试实例的个数,然后是C 行数据,每行包含一个整数n(0<n<=10000),表原创 2016-11-20 09:14:41 · 469 阅读 · 0 评论 -
hdu Max Factor
Max Factor题意:输入一个正整数n(1 ),然后输入n个正整数(1代码示例:#includeint a[30000];void is_sushu(){ int i,j; a[1]=1; for(i=2; i { if(a[i]==0) { for(j=i;转载 2016-11-17 16:52:56 · 721 阅读 · 0 评论 -
ZOJ 2316 Matrix Multiplication(找规律)(矩阵和它的转置矩阵之积)
Matrix MultiplicationLet us consider undirected graph G = which has N vertices and M edges. Incidence matrix of this graph is N * M matrix A = {aij}, such that aij is 1 if i-th vertex is one of the end原创 2017-04-18 21:59:24 · 870 阅读 · 0 评论 -
nyoj 1249 物资调度(DP)
物资调度描述 某地区发生了地震,灾区已经非常困难,灾民急需一些帐篷、衣物、食品和血浆等物资。可通往灾区的道路到处都是塌方,70%以上的路面损坏,桥梁全部被毁。国家立即启动应急预案,展开史上最大强度非作战空运行动,准备向灾区空投急需物资。 一方有难,八方支援。现在已知有N个地方分别有A1,A2,….,An个物资可供调配。目前灾区需要物资数量为M。 现在,请你帮忙算一算,总共有多少种物质调度方案。原创 2017-04-30 19:52:14 · 714 阅读 · 0 评论 -
大数相乘+大数相加
大数相乘简单版大数相乘代码:#include#includeint main(){ char a[110],b[110]; while(~scanf("%s %s",a,b)) { int c[110],d[110],e[110]; memset(e,0,sizeof(e)); int i=0,j=0;原创 2016-12-06 23:06:41 · 561 阅读 · 0 评论 -
hdu 6152 Friend-Graph(拉姆齐定理)
Friend-Graph题目链接:Friend-Graph题意:给出n个人的关系,如果其中有三个人(或三个以上)相互认识或相互不认识,就输出Bad Team!,否则输出Great Team!思路:拉姆齐定理 对于n≥6的情况,直接输出Bad Team! n<6,直接暴力判断即可代码:#include<bits/stdc++.h>using namespace std;const int max原创 2017-09-06 09:28:01 · 603 阅读 · 0 评论 -
hdu 6112 今夕何夕(日期计算——蔡勒公式)
今夕何夕Problem Description今天是2017年8月6日,农历闰六月十五。小度独自凭栏,望着一轮圆月,发出了“今夕何夕,见此良人”的寂寞感慨。为了排遣郁结,它决定思考一个数学问题:接下来最近的哪一年里的同一个日子,和今天的星期数一样?比如今天是8月6日,星期日。下一个也是星期日的8月6日发生在2023年。小贴士:在公历中,能被4整除但不能被100整除,或能被400整除的年份即为闰年。I原创 2017-08-14 09:44:39 · 552 阅读 · 0 评论 -
hdu 6045 Is Derek lying?(2017 Multi-University Training Contest - Team 2)
Is Derek lying?Problem DescriptionDerek and Alfia are good friends.Derek is Chinese,and Alfia is Austrian.This summer holiday,they both participate in the summer camp of Borussia Dortmund.During the su原创 2017-07-27 17:39:49 · 568 阅读 · 0 评论 -
nyoj 括号配对问题
括号配对问题题目描述现在,有一行括号序列,请你检查这行括号是否配对。输入第一行输入一个数N(0<N<=100),表示有N组测试数据。后面的N行输入多组输入数据,每组输入数据都是一个字符串S(S的长度小于10000,且S不是空串),测试数据组数少于5组。数据保证S中只含有"[","]","(",")"四种字符输出每组输入数据的输出占原创 2016-11-18 17:56:52 · 478 阅读 · 0 评论 -
hdu Train Problem I(stack栈)
Train Problem I原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1022题目大意:有n个不同的火车,给你两个字符串,按照O1的顺序进站,判断能不能按照O2的顺序出站。代码:#include#include#includeusing namespace std;int main(){ int n;原创 2016-11-28 14:25:30 · 568 阅读 · 0 评论 -
hdu 1029 Ignatius and the Princess IV(水题)
Ignatius and the Princess IVProblem Description“OK, you are not too bad, em… But you can never pass the next test.” feng5166 says.“I will tell you an odd number N, and then N integers. There will be a原创 2017-05-20 21:04:32 · 479 阅读 · 0 评论 -
hdu The Frog's Games(二分枚举)
The Frog's Games原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=4004题目大意:长为L的河流,中间有n个石头,告诉你石头的位置,青蛙的跳跃能力至少为多少时最终跳m次能跳过终点思路:因为青蛙的跳跃能力越强需要的次数就越少,因此青蛙的跳跃能力有单调性,所以二分枚举青蛙的跳跃能力,再判断在这个能力下是否能够跳过去。这个用原创 2016-11-28 16:55:45 · 547 阅读 · 0 评论 -
hihoCoder 字符消除 (字符串处理)(枚举)
字符消除描述小Hi最近在玩一个字符消除游戏。给定一个只包含大写字母"ABC"的字符串s,消除过程是如下进行的:1)如果s包含长度超过1的由相同字母组成的子串,那么这些子串会被同时消除,余下的子串拼成新的字符串。例如"ABCCBCCCAA"中"CC","CCC"和"AA"会被同时消除,余下"AB"和"B"拼成新的字符串"ABB"。2)上述消除会反复一轮一轮进行,直到新原创 2016-11-29 09:44:15 · 773 阅读 · 0 评论 -
SCU 4489 misaka and last order(暴力枚举)
misaka and last orderDescriptionMisaka Mikoto is a main character of the Animation "To Aru Majutsu no Index" and "To Aru Kagaku no Railgun". She was enrolled into the Academy City to train he原创 2017-03-18 16:20:28 · 639 阅读 · 0 评论 -
2017蓝桥杯模拟题 风险度量(暴力枚举)
思路:由于数据范围比较小,所以直接枚举每一个点是否为关键点即可代码:#include<stdio.h>#define maxn 2000+10int pre[maxn],u[maxn],v[maxn];int n,m,x,y;void init(){ for(int i=1; i<=n; ++i) pre[i]=i;}int Find(int x){ if(原创 2017-04-06 18:04:47 · 973 阅读 · 0 评论 -
nyoj 1242 Interference Signal(暴力枚举)
描述 Dr.Kong’s laboratory monitor some interference signals. The interference signals can be digitized into a series of positive integer. May be, there are N integers a1,a2,…,an.Dr.Kong wants to know th原创 2017-04-24 08:33:08 · 389 阅读 · 0 评论 -
nyoj 字母统计
现在给你一个由小写字母组成字符串,要你找出字符串中出现次数最多的字母,如果出现次数最多字母有多个那么输出最小的那个。 Input 第一行输入一个正整数T(0随后T行输入一个字符串s,s长度小于1010。Output 每组数据输出占一行,输出出现次数最多的字符;Sample Input 3abcdbbaajsdhfjkshdfjksahdfjkh原创 2016-10-13 14:38:30 · 715 阅读 · 0 评论 -
nyoj 关于521
关于521描述 Acm队的流年对数学的研究不是很透彻,但是固执的他还是想一头扎进去。浏览网页的流年忽然看到了网上有人用玫瑰花瓣拼成了521三个数字,顿时觉得好浪漫,因为每个男生都会不经意的成为浪漫的制造者。此后,流年走到哪里都能看到5、2、1三个数字,他怒了,现在他想知道在连续的数中有多少数全部包含了这三个数字。例如12356就算一个,而5111就不算。特别的,如果他看到了521三转载 2016-11-04 09:50:57 · 433 阅读 · 0 评论 -
nyoj 孪生素数问题
孪生素数问题描述 写一个程序,找出给出素数范围内的所有孪生素数的组数。一般来说,孪生素数就是指两个素数距离为2,近的不能再近的相邻素数。有些童鞋一看到题就开始写程序,不仔细看题,咱们为了遏制一下读题不认真仔细的童鞋,规定,两个素数相邻为1的也成为孪生素数。输入第一行给出N(0接下来组测试数据给出m,表示找出m之前的所有孪生素数。(0输出每组测试数据输出占一行,该行为m范围内所有原创 2016-11-03 21:02:47 · 393 阅读 · 0 评论 -
Codeforces Round #387 (Div. 2) Servers
Servers原题链接:http://codeforces.com/problemset/problem/747/CThere are n servers in a laboratory, each of them can perform tasks. Each server has a unique id — integer from 1 to n.It is原创 2016-12-20 08:46:37 · 474 阅读 · 0 评论 -
nyoj +-字符串
+-字符串描述 Shiva得到了两个只有加号和减号的字符串,字串长度相同。Shiva一次可以把一个加号和它相邻的减号交换。他想知道最少需要多少次操作才能把第一个字符串变换成第二个字符串。你现在要去帮助他完成那个这个问题。输入多组测试数据每组数据有两行,每行包含一个由”+”和”-“最成的字符串。每个子符串长度不超过5000。输出仅一个整数,输出最少需要操作的次数。如果答案不存在,转载 2016-10-31 18:33:47 · 537 阅读 · 0 评论 -
hdu 大菲波数
大菲波数Problem DescriptionFibonacci数列,定义如下:f(1)=f(2)=1f(n)=f(n-1)+f(n-2) n>=3。计算第n项Fibonacci数值。 Input输入第一行为一个整数N,接下来N行为整数Pi(1 Output输出为N行,每行为对应的f(Pi)。原创 2016-12-27 11:54:32 · 521 阅读 · 0 评论 -
Codeforces Round 389 Div.2 B. Santa Claus and Keyboard Check(模拟)
B. Santa Claus and Keyboard Check原题链接:http://codeforces.com/problemset/problem/748/BSanta Claus decided to disassemble his keyboard to clean it. After he returned all the keys back, he sud原创 2016-12-25 22:51:07 · 1252 阅读 · 0 评论 -
hdu A+B
A+BDescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.InputThe first line of the input contains an integer原创 2016-11-25 07:41:02 · 940 阅读 · 0 评论 -
Codeforces Round #384 B. Chloe and the sequence
Chloe and the sequence原题链接:http://codeforces.com/problemset/problem/743/BChloe, the same as Vladik, is a competitive programmer. She didn't have any problems to get to the olympiad原创 2016-12-17 12:39:06 · 622 阅读 · 0 评论 -
nyoj 求余数
求余数描述现在给你一个自然数n,它的位数小于等于一百万,现在你要做的就是求出这个数除10003之后的余数输入第一行有一个整数m(1随后m行每行有一个自然数n。输出输出n整除10003之后的余数,每次输出占一行。样例输入345465456541样例输出456948代码示例:#include#includechar原创 2016-11-25 10:45:32 · 695 阅读 · 0 评论 -
Codeforces Round #375 Text Document Analysis
Text Document AnalysisDescriptionModern text editors usually show some information regarding the document being edited. For example, the number of words, the number of pages, or the原创 2016-11-24 21:38:48 · 355 阅读 · 0 评论 -
nyoj 独木舟上的旅行
独木舟上的旅行描述 进行一次独木舟的旅行活动,独木舟可以在港口租到,并且之间没有区别。一条独木舟最多只能乘坐两个人,且乘客的总重量不能超过独木舟的最大承载量。我们要尽量减少这次活动中的花销,所以要找出可以安置所有旅客的最少的独木舟条数。现在请写一个程序,读入独木舟的最大承载量、旅客数目和每位旅客的重量。根据给出的规则,计算要安置所有旅客必须的最少的独木舟条数,并输出结果。输入第一行原创 2016-10-28 19:20:42 · 548 阅读 · 0 评论