Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
好弱的代码啊:int main() { int order[5]; scanf("%d%d%d%d%d%d%d%d",&a1,&b1,&a2,&b2,&a3,&b3,&a4,&b4); top=0; for(int mask=0;mask<16;mask++) { order[0]=1; order[1]=2; order[2]=3; order[3]=4; for(int i=0;i<24;i++) { solve(mask,order[0],order[1],order[2],order[3]); next_permutation(order,order+4); } } sort(ans,ans+top); top=unique(ans,ans+top)-ans; printf("%d\n",ans[0].S); for(int i=0;i<top;i++) { if(ans[i].S!=ans[0].S)break; printf("%d %d\n",ans[i].f1,ans[i].f2); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator