摘要: 素数环时间限制:1000 ms | 内存限制:65535 KB难度:2描述有一个整数n,把从1到n的数字无重复的排列成环,且使每相邻两个数(包括首尾)的和都为素数,称为素数环。为了简便起见,我们规定每个素数环都从1开始。例如,下图就是6的一个素数环。输入有多组测试数据,每组输入一个n(0 2 #include 3 #include 4 int save[21],ans[21],step,n; 5 void dfs() 6 { 7 int i,k; 8 if(step==n) 9 {10 if(ans[step-1]%2==0&&ans[step-1]!=... 阅读全文
posted @ 2013-10-12 23:10 龚细军 阅读(445) 评论(0) 推荐(0) 编辑
摘要: Calling Extraterrestrial Intelligence AgainTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4083 Accepted Submission(s): 2140 Problem DescriptionA message from humans to extraterrestrial intelligence was sent through the Arecibo radio telescope in 阅读全文
posted @ 2013-10-12 19:34 龚细军 阅读(642) 评论(0) 推荐(0) 编辑