未分类
Focus5679
学生一枚
展开
-
C. Summarize to the Power of Two
C. Summarize to the Power of Twotime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA sequence a1,a2,…,anis called good if, for ea...原创 2018-07-28 11:01:24 · 240 阅读 · 0 评论 -
Message Decowding HDU - 2716
Message Decowding HDU - 2716The cows are thrilled because they've just learned about encrypting messages. They think they will be able to use secret messages to plot meetings with cows on other farms....原创 2018-05-12 13:44:51 · 221 阅读 · 0 评论 -
Speed Limit POJ - 2017
Speed Limit POJ - 2017 Bill and Ted are taking a road trip. But the odometer in their car is broken, so they don't know how many miles they have driven. Fortunately, Bill has a working stopwatch, so t...原创 2018-05-12 13:43:38 · 173 阅读 · 0 评论 -
字符串统计 HDU - 2017
对于给定的一个字符串,统计其中数字字符出现的次数。Input输入数据有多行,第一行是一个整数n,表示测试实例的个数,后面跟着n行,每行包括一个由字母和数字组成的字符串。Output对于每个测试实例,输出该串中数值的个数,每个输出占一行。Sample Input2asdfasdf123123asdfasdfasdf111111111asdfasdfasdfSample Output69题解:#...原创 2018-05-12 13:41:48 · 186 阅读 · 0 评论 -
Hopscotch POJ - 3050
Hopscotch POJ - 3050 The cows play the child's game of hopscotch in a non-traditional way. Instead of a linear set of numbered boxes into which to hop, the cows create a 5x5 rectilinear grid of digits...原创 2018-04-20 18:44:37 · 125 阅读 · 0 评论 -
第一届湖北省赛F. Flower Road
F. Flower RoadOnce upon a time, there was a beautiful princess named TQM, and a handsome prince named GSS. One day, the prince would like to visit the princess. While in front of the princess' house, ...原创 2018-04-23 20:48:14 · 176 阅读 · 0 评论 -
Network Saboteur FZU - 1346
Network Saboteur FZU - 1346 A university network is composed of N computers. System administrators gathered information on the traffic between nodes, and carefully divided the network into two subnetw...原创 2018-04-18 21:45:53 · 215 阅读 · 0 评论 -
房间安排
房间安排时间限制:3000 ms | 内存限制:65535 KB难度:2描述2010年上海世界博览会(Expo2010),是第41届世界博览会。于2010年5月1日至10月31日期间,在中国上海市举行。本次世博会也是由中国举办的首届世界博览会。上海世博会以“城市,让生活更美好”(Better City,Better Life)为主题,将充分探索21世纪城市生活。这次世博会总投资达450亿人民币...原创 2018-04-06 14:59:53 · 221 阅读 · 0 评论 -
Cleaning Shifts POJ - 2376
Farmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He always wants to have one cow working on cleaning things up and has divided the day i...原创 2018-04-06 14:22:52 · 202 阅读 · 0 评论 -
Curling 2.0 POJ - 3009
Curling 2.0 POJ - 3009On Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewhat different from ours. The game is played on an ice game board on which...原创 2018-04-12 17:04:23 · 117 阅读 · 0 评论 -
A Knight's Journey POJ - 2488
A Knight's Journey POJ - 2488 Background The knight is getting bored of seeing the same black and white squares again and again and has decided to make a journey around the world. Whenever a knight mo...原创 2018-04-17 22:33:27 · 141 阅读 · 0 评论 -
放苹果
放苹果 把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。Input第一行是测试数据的数目t(0 <= t <= 20)。以下每行均包含二个整数M和N,以空格分开。1<=M,N<=10。Output对输入的每组数据M和N,用一行输出相应的K。Sample Input17 3Sample ...原创 2018-04-11 22:31:34 · 222 阅读 · 0 评论 -
蜘蛛牌 HDU - 1584
蜘蛛牌 蜘蛛牌是windows xp操作系统自带的一款纸牌游戏,游戏规则是这样的:只能将牌拖到比她大一的牌上面(A最小,K最大),如果拖动的牌上有按顺序排好的牌时,那么这些牌也跟着一起移动,游戏的目的是将所有的牌按同一花色从小到大排好,为了简单起见,我们的游戏只有同一花色的10张牌,从A到10,且随机的在一行上展开,编号从1到10,把第i号上的牌移到第j号牌上,移动距离为abs(i-j),现在你要...原创 2018-04-11 21:12:16 · 228 阅读 · 0 评论 -
Fibonacci String HDU - 1708
Fibonacci String HDU - 1708 After little Jim learned Fibonacci Number in the class , he was very interest in it.Now he is thinking about a new thing -- Fibonacci String . He defines : str[n] = str[n-1...原创 2018-05-12 13:46:36 · 219 阅读 · 0 评论 -
Calendar POJ - 2080
Calendar POJ - 2080 A calendar is a system for measuring time, from hours and minutes, to months and days, and finally to years and centuries. The terms of hour, day, month, year and century are all u...原创 2018-05-12 13:47:42 · 153 阅读 · 0 评论 -
Big Number POJ - 1423
Big Number POJ - 1423 In many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are...原创 2018-05-13 13:14:19 · 128 阅读 · 0 评论 -
Max Sum HDU1003
Max SumGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14.In...原创 2018-07-29 20:03:22 · 278 阅读 · 0 评论 -
A + B Problem II HDU1002
A + B Problem II HDU1002I 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 T(1<=...原创 2018-07-29 19:41:13 · 98 阅读 · 0 评论 -
I Hate It HDU1754
I Hate ItTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 98290 Accepted Submission(s): 37067 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。...原创 2018-07-29 16:23:36 · 147 阅读 · 0 评论 -
敌兵布阵HDU1166
敌兵布阵HDU1166C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。中央情报局要研究...原创 2018-07-29 14:16:24 · 148 阅读 · 0 评论 -
最短路HDU2544
最短路Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 86468 Accepted Submission(s): 37421 Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的...原创 2018-07-28 18:35:26 · 99 阅读 · 0 评论 -
畅通工程HDU1232
畅通工程Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 67535 Accepted Submission(s): 36027 Problem Description某省调查城镇交通状况,得到现有城镇道路统计表,表中列...原创 2018-07-28 16:40:36 · 146 阅读 · 0 评论 -
Diverse Team
A. Diverse Teamtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n students in a school class, the rating of the i-th student on Codehorses...原创 2018-06-24 12:01:21 · 206 阅读 · 0 评论 -
codeM2018 B轮 A 开关灯
[编程|500分] 开关灯时间限制:C/C++ 1秒,其他语言 2秒空间限制:C/C++ 262144K,其他语言 524288K64bit IO Format: %lld题目描述美团的办公室一共有n层,每层有m个会议室,可以看成是一个n*m的网格图。工程师们每天的工作需要协作的地方很多,经常要到会议室开会解决各种问题。公司是提倡勤俭节约的,因此每次会议室只在使用时才开灯。 当一个工程师进入会议室...原创 2018-06-23 18:53:24 · 191 阅读 · 1 评论 -
Substrings Sort
B. Substrings Sorttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given nn strings. Each string consists of lowercase English letters. Rear...原创 2018-06-03 17:24:42 · 267 阅读 · 0 评论 -
Filling Out the Team POJ - 2070
Filling Out the Team POJ - 2070 Over the years, the people of the great city of Pittsburgh have repeatedly demonstrated a collective expertise at football second to none. Recently a spy has discovered...原创 2018-05-13 13:15:59 · 151 阅读 · 0 评论 -
Lake Counting POJ - 2386
Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) squares. Each square contains ei...原创 2018-04-03 16:19:24 · 109 阅读 · 0 评论 -
cigarettes
cigarettes时间限制:3000 ms | 内存限制:65535 KB难度:2描述Tom has many cigarettes. We hypothesized that he has n cigarettes and smokes themone by one keeping all the butts. Out of k > 1 butt原创 2018-02-03 19:59:23 · 180 阅读 · 0 评论 -
素数距离问题
素数距离问题时间限制:3000 ms | 内存限制:65535 KB难度:2描述现在给出你一些数,要求你写出一个程序,输出这些整数相邻最近的素数,并输出其相距长度。如果左右有等距离长度素数,则输出左侧的值及相应距离。如果输入的整数本身就是素数,则输出该素数本身,距离输出0输入第一行给出测试数据组数N(0接下来的N行每行有一个整数M(0输出每行输出原创 2018-01-27 19:25:59 · 284 阅读 · 0 评论 -
素数求和问题
素数求和问题时间限制:3000 ms | 内存限制:65535 KB难度:2描述现在给你N个数(0<N<1000),现在要求你写出一个程序,找出这N个数中的所有素数,并求和。输入第一行给出整数M(0每组测试数据第一行给你N,代表该组测试数据的数量。接下来的N个数为要测试的数据,每个数小于1000输出每组测试数据结果占一行,输出给出的测试数据的所有原创 2018-01-27 17:40:02 · 177 阅读 · 0 评论 -
Fibonacci数
Fibonacci数时间限制:3000 ms | 内存限制:65535 KB难度:1描述无穷数列1,1,2,3,5,8,13,21,34,55...称为Fibonacci数列,它可以递归地定义为F(n)=1 ...........(n=1或n=2)F(n)=F(n-1)+F(n-2).....(n>2)现要你来求第n个斐波那契数。(第1个、第二个都为1)原创 2018-01-26 23:46:04 · 262 阅读 · 0 评论 -
奇偶数分离
奇偶数分离时间限制:3000 ms | 内存限制:65535 KB难度:1描述有一个整型偶数n(2<= n <=10000),你要做的是:先把1到n中的所有奇数从小到大输出,再把所有的偶数从小到大输出。输入第一行有一个整数i(2每组有一个整型偶数n。输出第一行输出所有的奇数第二行输出所有的偶数样例输入21原创 2018-01-26 23:12:55 · 176 阅读 · 0 评论 -
ASCII码排序
ASCII码排序时间限制:3000 ms | 内存限制:65535 KB难度:2描述输入三个字符(可以重复)后,按各字符的ASCII码从小到大的顺序输出这三个字符。输入第一行输入一个数N,表示有N组测试数据。后面的N行输入多组数据,每组输入数据都是占一行,有三个字符组成,之间无空格。输出对于每组输入数据,输出一行,字符中间用一个空格分开。样例输入2原创 2018-01-26 21:25:05 · 327 阅读 · 0 评论 -
另一种阶乘问题
另一种阶乘问题时间限制:3000 ms | 内存限制:65535 KB难度:1描述大家都知道阶乘这个概念,举个简单的例子:5!=1*2*3*4*5.现在我们引入一种新的阶乘概念,将原来的每个数相乘变为i不大于n的所有奇数相乘例如:5!!=1*3*5.现在明白现在这种阶乘的意思了吧!现在你的任务是求出1!!+2!!......+n!!的正确值(n原创 2018-02-01 01:22:19 · 177 阅读 · 0 评论 -
鸡兔同笼
鸡兔同笼时间限制:3000 ms | 内存限制:65535 KB难度:1描述已知鸡和兔的总数量为n,总腿数为m。输入n和m,依次输出鸡和兔的数目,如果无解,则输出“No answer”(不要引号)。输入第一行输入一个数据a,代表接下来共有几组数据,在接下来的(aa行里,每行都有一个n和m.(0输出输出鸡兔的个数,或者No answer样例输入2原创 2018-02-01 00:29:17 · 182 阅读 · 0 评论 -
笨小熊
笨小熊时间限制:2000 ms | 内存限制:65535 KB难度:2描述笨小熊的词汇量很小,所以每次做英语选择题的时候都很头疼。但是他找到了一种方法,经试验证明,用这种方法去选择选项的时候选对的几率非常大! 这种方法的具体描述如下:假设maxn是单词中出现次数最多的字母的出现次数,minn是单词中出现次数最少的字母的出现次数,如果maxn-minn是一原创 2018-01-31 19:45:21 · 106 阅读 · 0 评论 -
谁获得了最高奖学金
谁获得了最高奖学金时间限制:1000 ms | 内存限制:65535 KB难度:2描述 某校的惯例是在每学期的期末考试之后发放奖学金。发放的奖学金共有五种,获取的条件各自不同: 1) 院士奖学金,每人8000元,期末平均成绩高于80分(>80),并且在本学期内发表1篇或1篇以上论文的学生均可获得; 2) 五四奖学金,每人4000元,期末平均成绩高于原创 2018-01-30 19:26:47 · 210 阅读 · 0 评论 -
6174问题
6174问题时间限制:1000 ms | 内存限制:65535 KB难度:2描述假设你有一个各位数字互不相同的四位数,把所有的数字从大到小排序后得到a,从小到大后得到b,然后用a-b替换原来这个数,并且继续操作。例如,从1234出发,依次可以得到4321-1234=3087、8730-378=8352、8532-2358=6174,又回到了它自己!现在要你写原创 2018-01-30 18:37:57 · 276 阅读 · 0 评论 -
公约数和公倍数
公约数和公倍数时间限制:1000 ms | 内存限制:65535 KB难度:1描述小明被一个问题给难住了,现在需要你帮帮忙。问题是:给出两个正整数,求出它们的最大公约数和最小公倍数。输入第一行输入一个整数n(0随后的n行输入两个整数i,j(0输出输出每组测试数据的最大公约数和最小公倍数样例输入36 612 1133 22样例输出6原创 2018-01-29 21:01:24 · 159 阅读 · 0 评论 -
n-1位数
n-1位数时间限制:3000 ms | 内存限制:65535 KB难度:1描述已知w是一个大于10但不大于1000000的无符号整数,若w是n(n≥2)位的整数,则求出w的后n-1位的数。输入第一行为M,表示测试数据组数。接下来M行,每行包含一个测试数据。输出输出M行,每行为对应行的n-1位数(忽略前缀0)。如果除了最高位外,其余位都为0,则原创 2018-02-03 22:58:37 · 189 阅读 · 0 评论