2011年3月18日

zjut 小X的苹果

摘要: http://acm.zjut.edu.cn/ShowContestProblem.aspx?ShowID=优先队列&MID=528View Code 1 #include<iostream> 2 #include<stdio.h> 3 #include<string> 4 #include<queue> 5 using namespace std; 6 int main() 7 { 8 int cas,n,a,q,ok; 9 string s;10 scanf("%d",&cas);11 while(cas- 阅读全文
posted @ 2011-03-18 18:03 4.5.6 阅读(205) 评论(0) 推荐(0) 编辑

zoj2966 build the electric system

摘要: 1 2966最小树并查集模板Build The Electric System 2 #include<stdio.h> 3 #include<algorithm> 4 using namespace std; 5 int pre[501],fee; 6 struct side 7 { 8 int u,v,x; 9 }a[501];10 bool cmp(const side & a,const side & b)11 {12 return a.x<b.x;13 }14 int find(int x)15 {16 int r=x;17 while(p 阅读全文
posted @ 2011-03-18 17:58 4.5.6 阅读(411) 评论(0) 推荐(0) 编辑

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 阅读(238) 评论(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 阅读(754) 评论(2) 推荐(0) 编辑