2011年7月23日

sicily 1373. Cows Of The Round Ta

摘要: #include<iostream>#include<cstdlib>using namespace std;int n,k,num[20],seq[20],vis[20],s;void search(int id){ if(id==n) s++; else { for(int i=0;i<n;++i) if(vis[i]==0&&abs(num[i]-seq[id-1])<=k) { if(id==n-1&&abs(num[i]-seq[0])>k) continue; seq[id]=num[i]; vis[i]=1 阅读全文

posted @ 2011-07-23 15:37 sysu_mjc 阅读(187) 评论(0) 推荐(0) 编辑

sicily 1663. Party Party Party

摘要: #include<iostream> #include<stdio.h>#include<cstring>using namespace std;int party[100][2],vis[100],p,s,e;int main(){ int t=1,i,j,k; while(cin>>p,p) { for(i=0;i<p;++i) { cin>>s>>e; party[i][0]=8+(s-8)*2; //把一刻钟拆成两半 party[i][1]=8+(e-8)*2; } memset(vis,0,sizeof(v 阅读全文

posted @ 2011-07-23 15:36 sysu_mjc 阅读(197) 评论(0) 推荐(0) 编辑

sicily 1775. Simple Sort

摘要: #include<iostream> #include<stdio.h>#include<algorithm>using namespace std;int n,m;struct Priority{ int id,p; bool operator<(const Priority& other)const { return p<other.p; }}col[12];struct Node{ int id,x[12]; bool operator<(const Node& other)const { for(int i=1;i& 阅读全文

posted @ 2011-07-23 10:48 sysu_mjc 阅读(472) 评论(0) 推荐(0) 编辑

导航