上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 16 下一页
摘要: /*周期串的求法如果字符串可以由某个字符串重复多次得到,我们说该串以k为周期.输入长度不超过80的串,求最小周期.*/#include<iostream>#include<string.h>using namespace std;int main(){ char word[100]; scanf("%s",word); int len =strlen(word); for(int i=1;i<len;i++)if(len%i==0) { int ok=1; for(int j=i;j<len;j++) if(wor... 阅读全文
posted @ 2012-11-18 22:23 myth_HG 阅读(787) 评论(0) 推荐(0) 编辑
摘要: /*GCommando WarInput: Standard InputOutput: Standard Output“Waiting for orders we held in the wood, word from the front never cameBy evening the sound of the gunfire was miles awayAh softly we moved through the shadows, slip away through the treesCrossing their lines in the mists in the fields on ou 阅读全文
posted @ 2012-11-18 00:39 myth_HG 阅读(500) 评论(0) 推荐(0) 编辑
摘要: /*O - Dragon of LoowaterTime Limit:1000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmitStatusDescriptionProblem C: The Dragon of Loowater Once upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem. The shores of Rellau Creek in central Loowater had always... 阅读全文
posted @ 2012-11-18 00:25 myth_HG 阅读(209) 评论(0) 推荐(0) 编辑
摘要: #pragma warning (disable:4786) #include<cstdio>#include<iostream>#include<string>#include<string.h>#include<set>using namespace std;int main(){ set<string> st; string s=""; char c; while((c=getchar())!='#') { s+=c; while(c!='\n') { while( 阅读全文
posted @ 2012-11-17 18:40 myth_HG 阅读(317) 评论(0) 推荐(0) 编辑
摘要: #pragma warning (disable:4786) #include <map>#include <string>#include <iostream>using namespace std;int main(){ map<int, string> mapStudent; mapStudent.insert(pair<int, string>(1, "student_one")); mapStudent.insert(pair<int, string>(2, "student_two 阅读全文
posted @ 2012-11-17 18:27 myth_HG 阅读(134) 评论(0) 推荐(0) 编辑
摘要: /*Problem D Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 21 Accepted Submission(s) : 3Problem Description 对给定的字符串(只包含'z','o','j'三种字符),判断他是否能AC。是否AC的规则如下:1. zoj能AC;2. 若字符串形式为xzojx,则也能AC,其中x可以是N个'o' 或者为空;3. 若azbjc 能 阅读全文
posted @ 2012-11-16 23:08 myth_HG 阅读(354) 评论(0) 推荐(0) 编辑
摘要: Input 输入格式:测试输入包含若干测试用例。每个测试用例占一行,给出m和A,B的值。当m为0时输入结束。 Output 输出格式:每个测试用例的输出占一行,输出A+B的m进制数。 Sample Input8 1300 482 1 70 Sample Output25041000*/#include<iostream>using namespace std;int main(){ int c[20]={0},n,a,b; while(scanf("%d",&n),n) { int i=0; scanf("%d%d",&a,& 阅读全文
posted @ 2012-11-16 23:07 myth_HG 阅读(139) 评论(0) 推荐(0) 编辑
摘要: /*Problem A Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 8 Accepted Submission(s) : 6Problem Description 读入两个小于100的正整数A和B,计算A+B.需要注意的是:A和B的每一位数字由对应的英文单词给出. Input 测试输入包含若干测试用例,每个测试用例占一行,格式为"A + B =",相邻两字符串有一个空格间隔.当A和B同时为0时输入结束,相应的结果不要输出 阅读全文
posted @ 2012-11-16 23:07 myth_HG 阅读(260) 评论(0) 推荐(0) 编辑
摘要: /*Problem C Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 1 Accepted Submission(s) : 1Problem Description 给定两个整数A和B,其表示形式是:从个位开始,每三位数用逗号","隔开。现在请计算A+B的结果,并以正常形式输出。 Input 输入包含多组数据数据,每组数据占一行,由两个整数A和B组成(-10^9 < A,B < 10^9)。 Output 请计 阅读全文
posted @ 2012-11-16 23:05 myth_HG 阅读(689) 评论(0) 推荐(0) 编辑
摘要: /*构造哈夫曼数及哈夫曼编码*/#include<iostream>using namespace std;#define Maxlen 100typedef struct { int weight; int lchild,rchild,parent;}HTNode;typedef HTNode Hfmt[Maxlen];int n;void InitHfmt(Hfmt T){ int i; printf("\n\t\t请输入共有多少个权值(小于50):"); scanf(" %d",&n); getchar(); for(i=0;i 阅读全文
posted @ 2012-11-13 20:32 myth_HG 阅读(400) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 16 下一页