上一页 1 ··· 5 6 7 8 9
2011年3月18日

hdu1016 prime ring problem

摘要: Problem : 1016 ( Prime Ring Problem ) Judge Status : AcceptedRunId : 3644950 Language : C++ Author : zjut11018回溯法(同八皇后问题)DFS#include<stdio.h>#include<algorithm>usingnamespace std;int vis[41],pri[21],c[21],n;void dfs(int cur){if(cur==n){if(!pri[c[cur-1]+1])//注意判断首尾相加是否是素数{for(int i=0;i< 阅读全文
posted @ 2011-03-18 17:55 4.5.6 阅读(249) 评论(2) 推荐(0)

hdu1104 Remainder

摘要: Problem : 1104 ( Remainder ) Judge Status : AcceptedCode Render Status : Rendered By HDOJ G++ Code Render Version 0.01 Beta#include<stdio.h>#include<iostream>#include<string>#include<cstring>#include<queue>using namespace std;struct cc{ int n,m;};string op[1005];int ste 阅读全文
posted @ 2011-03-18 17:38 4.5.6 阅读(765) 评论(2) 推荐(0)
上一页 1 ··· 5 6 7 8 9