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 |
帮帮忙 看看有什么么数据过不了 谢谢 是WA#include <stdio.h> #include <algorithm> const int CAPACITY=200; const int MAX=230001; const int BUCKET=MAX/CAPACITY+1; const int N = 15000; int bucket[BUCKET+1],a[MAX+1]; int level[N+1]; int main() { int i,j,n,x,y,big,s; memset(bucket,0,sizeof(bucket)); memset(a,0,sizeof(a)); memset(level,0,sizeof(level)); scanf("%d",&n); for(i=0;i<n;i++) { s=0; scanf("%d%d",&x,&y); big=x/CAPACITY; for(j=0;j<big;j++) s+=bucket[j]; for(j=CAPACITY*big+1;j<=x;j++) s+=a[j]; level[s]++; a[x]++; bucket[(x-1)/CAPACITY]++; } for(i=0;i<n;i++) printf("%d\n",level[i]); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator