摘要: 1493: 平面划分http://www.acmore.net/problem.php?id=1493Time Limit:1 SecMemory Limit:128 MBSubmit:139Solved:32SubmitStatusWeb BoardDescription一条直线能够将平面分成2部分,两条直线能够将平面分成4部分,而对于一条“V”型线而言,平面被分成2部分,两条“V”型线最多能够将平面分成7部分。对于椭圆封闭曲线对平面的划分又将不一样,任意两个椭圆至多有两个交点。现在给定一个N,你能够计算出三种不同情况下,空间最多被划分出多少个部分吗?Input若干组测试数据,每组测试数据占 阅读全文
posted @ 2013-04-13 21:50 Jack Ge 阅读(365) 评论(0) 推荐(0)
摘要: 1492: 费马定理http://www.acmore.net/problem.php?id=1492Time Limit:1 SecMemory Limit:128 MBSubmit:82Solved:14SubmitStatusWeb BoardDescription以数学家命名的定理有很多,其中费马定理就是其中之一,费马定理表明如果一个素数p不能整除整数a那么a^(p-1)%p=1恒成立。试验可知p-1并不一定是该式成立的最小指数,那么你能找出最小的指数x满足a^x%p=1吗?Input若干组测试数据,每组数据占一行共两个整数a(1#include#include#includeusin 阅读全文
posted @ 2013-04-13 21:01 Jack Ge 阅读(425) 评论(0) 推荐(0)
摘要: 1494: 连续子串和续http://www.acmore.net/problem.php?id=1494Time Limit:10 SecMemory Limit:128 MBSubmit:99Solved:18SubmitStatusWeb BoardDescription小Y要去参加一场笔试,这场笔试有N道题目,每道题目有不同的分值和难度,分别为ai和bi。小Y想知道从某一题开始,至少连续K道题目,分值的和与难度的和的比率最大是多少?Input若干组测试数据,每组测试数据占3行。第一行输出两个正整数N(1<=N<=10^6),K(1<=K<=N)。第二行N个正整数 阅读全文
posted @ 2013-04-13 20:31 Jack Ge 阅读(393) 评论(0) 推荐(0)
摘要: 1490: 连续子串和http://www.acmore.net/problem.php?id=1490Time Limit:1 SecMemory Limit:128 MBSubmit:209Solved:36SubmitStatusWeb BoardDescription小Y前段时间刚刚做完连续子串和问题,相信大家对连续子串和也都不陌生,现在小Y又碰到了一个新的难题,给定N个整数,求至少K个数连续的最大和为多少?Input若干组测试数据,每组数据第一行给出两个数N(1#include#includeusing namespace std;const int maxn=1000010;con 阅读全文
posted @ 2013-04-13 20:07 Jack Ge 阅读(294) 评论(0) 推荐(0)
摘要: 1489: 数字排列http://www.acmore.net/problem.php?id=1489Time Limit:1 SecMemory Limit:128 MBSubmit:213Solved:77SubmitStatusWeb BoardDescription小Y得到了一个数,他认为相邻位上的数字与数字之间会产生不良影响,比如123,1和2之间产生一个不良影响值,2和3之间产生一个不良影响值。现在他想调整这个数每位的数字的顺序,使得最终得到的数的总的不良影响值最小,且没有前导0。Input输入数据的第一行为T表示有T组数据。每组数据先输入一个整数n(0#include#inclu 阅读全文
posted @ 2013-04-13 18:10 Jack Ge 阅读(391) 评论(0) 推荐(0)
摘要: KingTime Limit:1000MSMemory Limit:10000KTotal Submissions:8492Accepted:3203DescriptionOnce, in one kingdom, there was a queen and that queen was expecting a baby. The queen prayed: ``If my child was a son and if only he was a sound king.'' After nine months her child was born, and indeed, sh 阅读全文
posted @ 2013-04-13 11:04 Jack Ge 阅读(595) 评论(1) 推荐(0)
摘要: Cashier EmploymentTime Limit:1000MSMemory Limit:10000KTotal Submissions:6401Accepted:2312DescriptionA supermarket in Tehran is open 24 hours a day every day and needs a number of cashiers to fit its need. The supermarket manager has hired you to help him, solve his problem. The problem is that the s 阅读全文
posted @ 2013-04-13 10:18 Jack Ge 阅读(1120) 评论(0) 推荐(0)
摘要: Network of SchoolsTime Limit:1000MSMemory Limit:10000KTotal Submissions:8632Accepted:3408DescriptionA number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software (the “receiving sc 阅读全文
posted @ 2013-04-13 08:15 Jack Ge 阅读(220) 评论(0) 推荐(0)