其实topcoder也是蛮有意思的啊,就刷了题水的View Code #include<stdio.h>#include<vector>#include<string>using namespace std;class RedAndGreen{public : int minPaints(string row) { int i,j; int a[55],flag[55]; memset(flag,0,sizeof(flag)); int len=row.length(); int tot=0; fo... Read More
posted @ 2011-10-13 21:11 Because Of You Views(154) Comments(0) Diggs(0) Edit
第一次做,模仿着敲的View Code #include<stdio.h>#include<string.h>#define maxn 1000000struct que{ int x,val; que(int xx,int yy):x(xx),val(yy){} que(){};}q[maxn];int main(){ int t; char name[6],na[10]; int rp; scanf("%d",&t); while(t--) { int i,j,k,head=0,tail=-1,leave=0,K=1; ... Read More
posted @ 2011-10-13 16:36 Because Of You Views(312) Comments(0) Diggs(0) Edit
终极模板View Code #include<stdio.h>#include<string.h>#include<algorithm>using namespace std;const int N = 10010;const int M = 100010;int min(int a,int b){ return a>b?b:a;}struct EDGE{ int to,next,id;}edge[2*M];int n,m,tot,tdfn,nbridge;int head[N],vis[N],low[N],dfn[N],bridge[M];void Read More
posted @ 2011-10-13 09:09 Because Of You Views(294) Comments(0) Diggs(0) Edit