csu 1535: Pizza voting(思维)
http://acm.csu.edu.cn/OnlineJudge/showsource.php?id=97625
#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; int a[200000]; int main() { int n,m; int i,j,k; while(scanf("%d%d",&n,&m)!=EOF) { int t1; char t2[1000]; for(i=0;i<n;i++) scanf("%d%s",&t1,t2); int l=n/3; int r=n-n/3+1; if(n%3==2) r--; if(m>l&&m<r) printf("YES\n"); else printf("NO\n"); } return 0; }