上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 53 下一页
摘要: Bus PassTime Limit: 5 Seconds Memory Limit: 32768 KB You travel a lot by bus and the costs of all the seperate tickets are starting to add up.Therefore you want to see if it might be advantageous for you to buy a bus pass.The way the bus system works in your country (and also in the Netherlands) is 阅读全文
posted @ 2013-02-11 15:01 剑不飞 阅读(260) 评论(0) 推荐(0) 编辑
摘要: RescueTime Limit: 2 Seconds Memory Limit: 65536 KB Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M #include #include #include using namespace std; const int oo=1e9; const int mm=233; const int dx[]={1,-1,0,0}; const int dy[]={0,0,1,-1}; int. 阅读全文
posted @ 2013-02-11 12:56 剑不飞 阅读(99) 评论(0) 推荐(0) 编辑
摘要: Gnome TetravexTime Limit: 10 Seconds Memory Limit: 32768 KB Hart is engaged in playing an interesting game, Gnome Tetravex, these days. In the game, at the beginning, the player is given n*n squares. Each square is divided into four triangles marked four numbers (range from 0 to 9). In a square, the 阅读全文
posted @ 2013-02-11 12:12 剑不飞 阅读(132) 评论(0) 推荐(0) 编辑
摘要: C - Mail StampsCrawling in process...Crawling failedTime Limit:2000MSMemory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmitStatus Practice CodeForces 29C DescriptionOne day Bob got a letter in an envelope. Bob knows that when Berland's post officers send a letter directly from city«A 阅读全文
posted @ 2013-02-09 11:13 剑不飞 阅读(311) 评论(0) 推荐(0) 编辑
摘要: D - Ant on the TreeCrawling in process...Crawling failedTime Limit:2000MSMemory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmitStatus DescriptionConnected undirected graph without cycles is called a tree. Trees is a class of graphs which is interesting not only for people, but for ants too.An 阅读全文
posted @ 2013-02-08 21:56 剑不飞 阅读(322) 评论(0) 推荐(0) 编辑
摘要: E - Number With The Given Amount Of DivisorsCrawling in process...Crawling failedTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPractice CodeForces 27E DescriptionGiven the number n, find the smallest positive integer which has exactlyn divisors. It is guaranteed 阅读全文
posted @ 2013-02-08 16:17 剑不飞 阅读(235) 评论(0) 推荐(0) 编辑
摘要: D. Ring Road 2time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt is well known that Berland hasncities, which form the Silver ring — citiesiandi + 1(1 ≤ i #include using namespace std; const int mm=110; int a[mm],b[mm],c[mm]; int n,m; bool flag;. 阅读全文
posted @ 2013-02-08 16:13 剑不飞 阅读(273) 评论(0) 推荐(0) 编辑
摘要: Divisor counting (Easy)Let σ(n)denote the number of divisors of n.Compute σ(1)+σ(2)+⋯+σ(n).InputAn integer n.(1≤n≤108)OutputThe sum.Sample input5Sample output10思路:计算 [1, X]区间内所有数字的因子个数之和这个等价于X / 1 + X / 2 + ... + X / X, 这里注意是整除,直接暴力(O(X)超时),所以就要分段求; 例如:X/[i………j]==X[k](i #include using namespace std; 阅读全文
posted @ 2013-02-08 13:27 剑不飞 阅读(154) 评论(0) 推荐(0) 编辑
摘要: XorFor given multisets AandB, find minimum non-negative xwhichA⊕x=B.Note that for A={a1,a2,…,an},A⊕x={a1⊕x,a2⊕x,…,an⊕x}.⊕stands for exclusive-or.InputThe first line contains a integer n, which denotes the size of set A(also for B).The second line contains nintegersa1,a2,…,an, which denote the set A. 阅读全文
posted @ 2013-02-07 21:00 剑不飞 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Square freeTest whether nis square free. nis square free if and only if for all p>1,p2is not divisors of n.InputThe first line contains an integer t, the number of test cases.The following nlines, each contains an integer n.(1≤t≤102,1≤n≤1018)OutputPrint "Yes" if nis square free, or &quo 阅读全文
posted @ 2013-02-07 20:14 剑不飞 阅读(201) 评论(0) 推荐(0) 编辑
上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 53 下一页