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 |
Nim 加枚举 可能速度慢了一点 50T 留念//poj 2068 //Nim #include <cmath> #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> #include <iostream> #include <queue> using namespace std; #define SIZE 1005 #define INF 10000000 int main() { int N; long long a[SIZE],sum,res; while(scanf("%d",&N),N){ for(int i=0;i<N;i++) scanf("%lld",&a[i]); res=0; for(int i=0;i<N;i++){ sum=0; for(int j=0;j<N;j++){ if(j==i) continue; sum^=a[j]; } if(a[i]-sum>0) res++; } printf("%lld\n",res); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator