Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

帮帮忙 看看有什么么数据过不了 谢谢 是WA

Posted by boys at 2006-08-08 16:43:32 on Problem 2352
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator