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 |
我这个怎么是output limit exeed啊?这是我的程序.#include<iostream> using namespace std; void comp(unsigned long a,unsigned long b,unsigned long& max,unsigned long &min)//判断大小,并装入max,min {if(a<b){min=a;max=b;} if(a>b){max=a;min=b;} if(a==b){max=a;min=b;} } bool judge(unsigned long &max,unsigned long &min) //判断能否胜出 {if(min==1&&max==2)return 0; if(min==0||min==1||min==2)return 1; if(max==(2*min-1))return 0; return 1; } int main() { unsigned long a,b; unsigned long max,min; for(;;) {cin>>a>>b; if(a>1000000000||b>1000000000)break; comp(a,b,max,min); if(judge(max,min)==1) cout<<"1"<<endl; if(judge(max,min)==0) cout<<"0"<<endl; } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator