摘要: /*Problem ETime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 1 Accepted Submission(s) : 1Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem DescriptionMatrix multiplication problem is a typical example of dynamical programming.Suppose you 阅读全文
posted @ 2012-07-29 20:14 myth_HG 阅读(266) 评论(0) 推荐(0) 编辑
摘要: Problem FTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 3 Accepted Submission(s) : 2Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem Description“Point, point, life of student!” This is a ballad(歌谣)well known in colleges, and you must 阅读全文
posted @ 2012-07-29 19:56 myth_HG 阅读(408) 评论(0) 推荐(0) 编辑
摘要: Problem GTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 7 Accepted Submission(s) : 3Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem DescriptionIn millions of newspapers across the United States there is a word game called Jumble. Th 阅读全文
posted @ 2012-07-29 10:46 myth_HG 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Problem HTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 6 Accepted Submission(s) : 2Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem Description The most important part of a GSM network is so called Base Transceiver Station (BTS). Th 阅读全文
posted @ 2012-07-28 20:53 myth_HG 阅读(454) 评论(0) 推荐(0) 编辑
摘要: /*2^x mod n = 1 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6738 Accepted Submission(s): 2022Problem Description Give a number n, find the minimum x(x>0) that satisfies 2^x mod n = 1.Input One positive integer on each line, the value of n. 阅读全文
posted @ 2012-07-28 17:07 myth_HG 阅读(1285) 评论(0) 推荐(0) 编辑
摘要: A+B ComingTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3359 Accepted Submission(s): 2087 Problem DescriptionMany classmates said to me that A+B is must needs. If you can’t AC this problem, you would invite me for night meal. ^_^InputInpu... 阅读全文
posted @ 2012-07-28 13:12 myth_HG 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 初等数论昨晚写到凌晨近一点,终于把自己目前会的数论知识做了下终结,最后发现原来只有这么点东西。。。路还好远O(∩_∩)O哈!一.求最大公约数:gcd(a,b)代表a,b的最大公约数,设为d;(1)朴素算法:暴力枚举咯.,先比较a,b大小,然后从1开始直到较小的那个数,算出最大可以被2数同时整除的数,... 阅读全文
posted @ 2012-07-28 11:13 myth_HG 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 除了2以外,素数都是奇数,这是关键1.快速查找素数(范围大所以用数组)#include #include #include #include #define N 1000000using namespace std;bool hash[N];int main(){ int i,j=0;(最快)0.3sfor(j=4;j#include#include#includeusing namespace std;const int M1=2000100,M2=1000000;bool NotPrime[M1]={1,1,0};int Prime[M2];int PrimeNum=0;int main( 阅读全文
posted @ 2012-07-28 11:01 myth_HG 阅读(351) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<stdio.h>#include<cstring>#include<iomanip>usingnamespacestd;intmain(){inti,sum,l,k,j,h;charc[1000],c1[1000][1000];while(cin.getline(c,999)){sum=0;if(strcmp(c,"#")==0)break;l=strlen(c);k=0;j=0;for(i=0;i<l;i++){if(c[i]!='')c1[k][j 阅读全文
posted @ 2012-07-27 21:20 myth_HG 阅读(333) 评论(0) 推荐(0) 编辑
摘要: *Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7012 Accepted Submission(s): 4968Problem Description "Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 阅读全文
posted @ 2012-07-27 21:08 myth_HG 阅读(183) 评论(0) 推荐(0) 编辑