2015年10月24日
摘要:
DescriptionOne of the first users of BIT’s new supercomputer was Chip Diller. He extended his exploration of powers of 3 to go from 0 to 333 ...
阅读全文
posted @ 2015-10-24 13:59
cnxo
阅读(169)
推荐(0)
2015年10月23日
摘要:
DescriptionYou have devised a new encryption technique which encodes a message by inserting between its characters randomly generated strings...
阅读全文
posted @ 2015-10-23 18:42
cnxo
阅读(132)
推荐(0)
2015年9月28日
摘要:
/**口袋里有红、黄、蓝、白、黒5种颜色的球若干,每次从口袋中先后取出3个球,问得到3种不同颜色的球的可能取法,输出每种排列的情况**/#include #include int main(){ enum Color {red,yellow,blue,white,black}...
阅读全文
posted @ 2015-09-28 20:15
cnxo
阅读(183)
推荐(0)
摘要:
长度为n的环状串有n种表示法,分别为从某个位置开始顺时针得到。 求字典序最小的,也就是最小表示#include #include #define maxn 105int less(char *s,int p,int q){ int i,n; n=strlen(s); f...
阅读全文
posted @ 2015-09-28 19:32
cnxo
阅读(189)
推荐(0)
2015年9月26日
摘要:
Problem Description I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.Input The fir...
阅读全文
posted @ 2015-09-26 15:41
cnxo
阅读(165)
推荐(0)
摘要:
算法竞赛入门经典第二版p52 例题3-5: 如果x+x的各个数字之和得到y,就是说x是y的生成元。给出n(1#include #define maxn 100005int anx[maxn];int main(){ int T,n; memset(anx,0,sizeo...
阅读全文
posted @ 2015-09-26 15:10
cnxo
阅读(396)
推荐(0)
2015年9月22日
摘要:
样例输入:4样例输出:10 11 12 19 16 13 28 15 14 37 6 5 4#include #include #include int main(){ int a[50][50]; int i,j,x,y,cot,n;...
阅读全文
posted @ 2015-09-22 20:44
cnxo
阅读(136)
推荐(0)
摘要:
/**有n个灯,编号为1-n。第一个人把所以灯打开,第二个人按下 所有编号为2的倍数的开关,第三个人按下3的倍数的开关,依次类推, 一共有k个人,问最后有哪些灯开着? 样例输入: 7 3 样例输出: 1 5 6 7 **/#include #include #include int...
阅读全文
posted @ 2015-09-22 19:57
cnxo
阅读(224)
推荐(0)
2015年9月18日
摘要:
排序算法(Sorting Algorithm)是计算机算法的一个组成部分。排序的目标是将一组数据 (即一个序列) 重新排列,排列后的数据符合从大到小 (或者从小到大) 的次序。这是古老但依然富有挑战的问题。Donald Knuth的经典之作《计算机程序设计艺术》(The Art o...
阅读全文
posted @ 2015-09-18 16:42
cnxo
阅读(237)
推荐(0)
2015年9月15日
摘要:
Problem Description A number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n,...
阅读全文
posted @ 2015-09-15 20:09
cnxo
阅读(87)
推荐(0)