ACM/POJ/PAT/九度
文章平均质量分 77
zoushidexing
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
1054. The Dominant Color (20)-PAT
1054. The Dominant Color (20)时间限制100 ms内存限制32000 kB代码长度限制16000 B判题程序StandardBehind the scenes in the computer's memory, color is always原创 2013-08-03 19:36:05 · 1757 阅读 · 1 评论 -
在一N个整数查找序列中的最大数和最小数, 及 所需要的比较次数?
在一N个整数查找序列中的最大数和最小数 及 所需要的比较次数?思路:同时取出两个数,比较它们的大小,结果中大的数同当前max比较,小的数同当前min比较。比较第一组需要的次数+比较剩余每一组数需要的次数偶数个数,比较次数大致为:1+(1+2)*(N-2)/2 次,奇数个数:1+(1+2)*(N-2-1)/2 +1次#include #define N 12void get原创 2013-04-13 22:58:52 · 5308 阅读 · 0 评论 -
Increasing Sequences-ZOJ 1499 POJ 1039
Increasing SequencesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 2773 Accepted: 1039DescriptionGiven a string of digits, insert commas to create a se原创 2013-06-16 20:22:28 · 1327 阅读 · 0 评论 -
1059. Prime Factors (25)-PAT
1059. Prime Factors (25)时间限制50 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者HE, QinmingGiven any positive integer N, you are suppo原创 2013-07-30 15:06:05 · 1866 阅读 · 0 评论 -
1053. Path of Equal Weight (30)-PAT
1053. Path of Equal Weight (30)时间限制10 ms内存限制32000 kB代码长度限制16000 B判题程序StandardGiven a non-empty tree with root R, and with weight Wi assi原创 2013-08-03 21:45:48 · 1530 阅读 · 0 评论 -
2386.Lack Counting -POJ
Lake CountingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 16090 Accepted: 8148DescriptionDue to recent rains, water has pooled in various places in F原创 2013-08-02 22:24:03 · 916 阅读 · 0 评论 -
1058. A+B in Hogwarts (20)- PAT
1058. A+B in Hogwarts (20)时间限制50 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueIf you are a fan of Harry Potter, you would原创 2013-07-30 16:00:48 · 1309 阅读 · 1 评论 -
1040. Longest Symmetric String-PAT 1528:最长回文子串-九度
1040. Longest Symmetric String (25)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven a string, you are supposed原创 2013-06-28 19:42:47 · 1122 阅读 · 0 评论 -
1011. Sticks(木棒) -POJ
SticksTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 110042 Accepted: 25243DescriptionGeorge took sticks of the same length and cut them randomly until原创 2013-07-27 22:58:04 · 1298 阅读 · 0 评论 -
1018. Public Bike Management (30)-PAT
1018. Public Bike Management (30)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueThere is a public bike service in H原创 2013-07-26 10:15:52 · 1859 阅读 · 0 评论 -
1009. Product of Polynomials (25)-PAT
1009. Product of Polynomials (25)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueThis time, you are supposed to find原创 2013-07-12 12:12:43 · 990 阅读 · 0 评论 -
1011. World Cup Betting (20)-PAT
1011. World Cup Betting (20)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueWith the 2010 FIFA World Cup running, fo原创 2013-07-13 21:11:19 · 1013 阅读 · 0 评论 -
1013. Battle Over Cities (25)-PAT
1013. Battle Over Cities (25)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueIt is vitally important to have all the原创 2013-07-16 20:13:55 · 1566 阅读 · 0 评论 -
题目1525:子串逆序打印-九度
题目1525:子串逆序打印题目描述:小明手中有很多字符串卡片,每个字符串中都包含有多个连续的空格,而且这些卡片在印刷的过程中将字符串的每个子串都打印反了,现在麻烦你帮小明将这些字符串中的子串修正过来,同时为了使卡片美观,压缩其中的连续空格为1个。输入:输入包含多个测试用例,每个测试用例的第一行是一个正整数 n,1=输出:对原创 2013-07-22 13:09:32 · 1354 阅读 · 0 评论 -
1031. Hello World for U (20)-PAT
1031. Hello World for U (20)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven any string of N (>=5) characters,原创 2013-07-21 11:10:22 · 726 阅读 · 0 评论 -
1056. Mice and Rice (25)-PAT
1056. Mice and Rice (25)时间限制30 ms内存限制32000 kB代码长度限制16000 B判题程序StandardMice and Rice is the name of a programming contest in which each p原创 2013-08-03 09:43:02 · 1971 阅读 · 0 评论 -
1001. A+B Format (20)
Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits).InputEach input file cont原创 2013-01-14 20:34:19 · 714 阅读 · 0 评论 -
1010. Radix (25)-PAT
1010. Radix (25)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven a pair of positive integers, for example, 6 an原创 2013-05-25 19:29:14 · 1870 阅读 · 4 评论 -
1003. Emergency (25)-PAT
1003. Emergency (25)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueAs an emergency rescue team leader of a city, yo原创 2013-07-08 16:35:36 · 1733 阅读 · 0 评论 -
1026. Table Tennis (30)-PAT
1026. Table Tennis (30)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA table tennis club has N tables available to原创 2013-07-27 14:32:35 · 1098 阅读 · 0 评论 -
1006. Sign In and Sign Out (25)-PAT
1006. Sign In and Sign Out (25)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueAt the beginning of every day, the fi原创 2013-07-11 14:34:51 · 1188 阅读 · 0 评论 -
题目1527:首尾相连数组的最大子数组和-九度
题目描述:给定一个由N个整数元素组成的数组arr,数组中有正数也有负数,这个数组不是一般的数组,其首尾是相连的。数组中一个或多个连续元素可以组成一个子数组,其中存在这样的子数组arr[i],…arr[n-1],arr[0],…,arr[j],现在请你这个ACM_Lover用一个最高效的方法帮忙找出所有连续子数组和的最大值(如果数组中的元素全部为负数,则最大和为0,即一个也没有选)。原创 2013-07-23 10:36:08 · 1065 阅读 · 0 评论 -
1014. Waiting in Line (30)-PAT
1014. Waiting in Line (30)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueSuppose a bank has N windows open for serv原创 2013-07-17 19:16:43 · 1255 阅读 · 0 评论 -
1055. The World's Richest (25)-PAT
1055. The World's Richest (25)时间限制200 ms内存限制128000 kB代码长度限制16000 B判题程序StandardForbes magazine publishes every year its list of billionai原创 2013-08-03 19:04:41 · 955 阅读 · 0 评论 -
1002. A+B for Polynomials (25)
This time, you are supposed to find A+B where A and B are two polynomials.InputEach input file contains one test case. Each case occupies 2 lines, and each line contains the information of a p原创 2013-01-14 19:34:55 · 1162 阅读 · 1 评论 -
1049. Counting Ones (30)-PAT
1049. Counting Ones (30)http://pat.zju.edu.cn/contests/pat-a-practise/1049时间限制10 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, Yue原创 2013-06-30 16:25:32 · 1330 阅读 · 0 评论 -
1007. Maximum Subsequence Sum (25)-PAT
1007. Maximum Subsequence Sum (25)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven a sequence of K integers { N原创 2013-06-30 23:04:12 · 1032 阅读 · 0 评论 -
1008. Elevator (20)-PAT
1008. Elevator (20)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueThe highest building in our city has only one ele原创 2013-07-11 15:06:20 · 821 阅读 · 0 评论 -
1060. Are They Equal (25)-PAT
1060. Are They Equal (25)时间限制50 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueIf a machine can save only 3 significant dig原创 2013-07-30 11:20:06 · 1842 阅读 · 1 评论 -
1021. Deepest Root (25)-PAT
1021. Deepest Root (25)时间限制1500 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA graph which is connected and acyclic can b原创 2013-07-29 18:41:48 · 2702 阅读 · 1 评论 -
1010-Tempter of the Bone -HDUOJ
Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 52780 Accepted Submission(s): 14191Problem DescriptionThe原创 2013-07-28 22:48:57 · 787 阅读 · 0 评论 -
1004. Counting Leaves (30)-PAT
1004. Counting Leaves (30)时间限制400 ms内存限制32000 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA family hierarchy is usually presented by a原创 2013-07-08 16:31:34 · 1546 阅读 · 0 评论 -
题目1529:棋盘寻宝 -九度
题目描述:现在有一个8*8的棋盘,上面放着64个价值不等的礼物,每个小的棋盘上面放置一个礼物(礼物的价值大于0小于1000),一个人的初始位置在棋盘的左上角,每次他只能向下或向右移动一步,并拿走对应棋盘上的礼物,结束位置在棋盘的右下角,请设计一个算法使其能够获得最大价值的礼物。输入:输入包含多个测试用例,每个测试用例共有8行8列,第i行的第j列的数字代表了该处棋盘上的礼物的价值原创 2013-08-19 10:41:27 · 1077 阅读 · 0 评论 -
题目1531:货币面值 - 九度
题目描述:小虎是游戏中的一个国王,在他管理的国家中发行了很多不同面额的纸币,用这些纸币进行任意的组合可以在游戏中购买各种装备来提升自己。有一天,他突然很想知道这些纸币的组合不能表示的最小面额是多少,请聪明的你来帮助小虎来解决这个财政问题吧。 输入:输入包含多个测试用例,每组测试用例的第一行输入一个整数N(N 输出:对于每组测试用例,输出一个整数,表示已经发行的所有纸币都原创 2013-08-19 12:50:53 · 1189 阅读 · 0 评论 -
题目1521:二叉树的镜像-九度
题目描述:输入一个二叉树,输出其镜像。输入:输入可能包含多个测试样例,输入以EOF结束。对于每个测试案例,输入的第一行为一个整数n(0Ci=’d’表示第i个节点有两子孩子,紧接着是左孩子编号和右孩子编号。Ci=’l’表示第i个节点有一个左孩子,紧接着是左孩子的编号。Ci=’r’表示第i个节点有一个右孩子,紧接着是右孩子的编号。Ci原创 2013-08-19 13:45:18 · 1049 阅读 · 0 评论 -
题目1530:最长不重复子串 -九度
题目描述:最长不重复子串就是从一个字符串中找到一个连续子串,该子串中任何两个字符都不能相同,且该子串的长度是最大的。 输入:输入包含多个测试用例,每组测试用例输入一行由小写英文字符a,b,c...x,y,z组成的字符串,字符串的长度不大于10000。 输出:对于每组测试用例,输出最大长度的不重复子串长度。 样例输入:absdabbaabdffd样例输出:原创 2013-08-19 10:43:54 · 1182 阅读 · 0 评论 -
题目1532:棋盘寻宝扩展 -九度
题目描述:现在有一个8*8的棋盘,上面放着64个不同价值的礼物,每个小的棋盘上面放置一个礼物(礼物的价值大于0小于100),一个人初始位置在棋盘的左上角,每次他只能向下或向右移动一步,并拿走对应棋盘上的礼物,结束位置在棋盘的右下角。从棋盘的左上角移动到右下角的时候的,每次他只能向下或向右移动一步,并拿走对应棋盘上的礼物,但是拿到的所有的礼物的价值之和不大于一个限定值limit,请设计一个算法请原创 2013-08-19 10:47:04 · 939 阅读 · 0 评论 -
1051. Pop Sequence (25)-PAT
1051. Pop Sequence (25)时间限制10 ms内存限制32000 kB代码长度限制16000 B判题程序StandardGiven a stack which can keep M numbers at most. Push N numbers in t原创 2013-08-06 17:21:48 · 1074 阅读 · 0 评论 -
1050. String Subtraction (20)-PAT
1050. String Subtraction (20)时间限制10 ms内存限制32000 kB代码长度限制16000 B判题程序StandardGiven two strings S1 and S2, S = S1 - S2 is defined to be the原创 2013-08-07 10:13:15 · 1100 阅读 · 0 评论 -
题目1366:栈的压入、弹出序列-九度
题目描述:输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否为该栈的弹出顺序。假设压入栈的所有数字均不相等。例如序列1,2,3,4,5是某栈的压入顺序,序列4,5,3,2,1是该压栈序列对应的一个弹出序列,但4,3,5,1,2就不可能是该压栈序列的弹出序列。输入:每个测试案例包括3行:第一行为1个整数n(1第二行包含n个整数,表示栈的压入顺序。第三行包含n个原创 2013-08-19 16:35:27 · 1184 阅读 · 0 评论
分享