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 |
help!why WA,can anyone give me some data to test?#include <iostream> using namespace std; int main() { unsigned long n, k; bool even; while (cin>>n>>k) { k=min(n-k,k); if (k>=4) { even=true; } else { switch(k) { case 0: even=false; break; case 1: even=(n%2==0); break; case 2: even=(n%4==0||(n-1)%4==0); break; case 3: even=(n%2==0||(n-1)%4==0); break; } } cout<<(even?0:1)<<endl; } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator