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 |
Re:虽然还不会做,但这么明显的博弈题怎么网上所有的分类都说是几何题,再也不信网上的分类了In Reply To:Re:虽然还不会做,但这么明显的博弈题怎么网上所有的分类都说是几何题,再也不信网上的分类了 Posted by:JiaJunpeng at 2012-12-16 23:00:31 > 明显主要考博弈论,几何处理只是浮云 猜了个结论G++过了,但C++WA,以下是代码,不知道为神马 Source Code Problem: 2315 User: JiaJunpeng Memory: 700K Time: 0MS Language: G++ Result: Accepted Source Code #include<iostream> #include<stdio.h> #include<algorithm> #include<cmath> #include<cstdlib> #include<cstring> #include<string> #include<vector> using namespace std; int n,m,l,r,c[33],k; double dist,pi=acos(-1.00),now,eps=1e-9; int main() { int i,j,s,p,q; while(scanf("%d%d%d%d",&n,&m,&l,&r)==4) { k=(int)((double)(l+eps)/(2*pi*r)); for(i=0;i<n;i++) { scanf("%lf",&dist); c[i]=(int)((dist-eps)/(2*pi*r))+1; c[i]%=k+1; } for(i=0;i<31;i++) { int value=0; for(j=0;j<n;j++) { if(c[j]&(1<<i)) value++; } if(value%(m+1)!=0) break; } if(i<31) puts("Alice"); else puts("Bob"); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator