ZOJ
李小三r
这个作者很懒,什么都没留下…
展开
-
ZOJ 3479 Chinese Zodiac
#includeint main(){ int T,y,i; scanf("%d",&T); for(i=0;iT;i++) { scanf("%d",&y); if(y%12==1) printf("Rabbit\n"); else if(y%12原创 2011-08-05 14:54:43 · 487 阅读 · 0 评论 -
zoj 1789 The Suspects (并查集)
并查集,一直wa,找了好长时间,才找到错误#include#includeint father[30005];int n,m,i,t,a,b,k,fa;int find(int x){ return father[x]==x?x:find(father[x])原创 2011-08-10 16:48:38 · 603 阅读 · 0 评论 -
zoj 1372 (最小生成树)
昨天把最小生成树搞明白了,做这题就随意的多了#include#include#include#include#includeusing namespace std;int father[55];int p,r,sum;typedef struct{ i原创 2011-08-14 10:57:44 · 527 阅读 · 0 评论 -
zoj 1406 最小生成树 kruskal 和 prim用法
#include#include#include#include#includeusing namespace std;int father[30],j,sum,n;typedef struct{ int x; int y; int原创 2011-08-13 09:56:52 · 497 阅读 · 0 评论 -
zoj 1025
一开始没头绪,看了别人的例子,用了结构体,最大上升子序列等知识#include#include#include#include#includeusing namespace std;#define N 5005typedef struct{ int l;原创 2011-08-20 10:52:35 · 451 阅读 · 0 评论 -
zoj 1093 Monkey and Banana
#include#include#include#include#includeusing namespace std;typedef struct{ int x; int y; int h; }edge;edge bloc原创 2011-08-22 11:26:25 · 506 阅读 · 0 评论 -
zoj 1259
栈的应用,用数组#include#include#include#include#includeusing namespace std;int main(){ int i,j,stack[1005],a[1005],n,top; whi原创 2011-08-23 18:51:07 · 487 阅读 · 0 评论