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

1000ms挤过。。

Posted by 2012xie at 2013-02-22 12:02:59 on Problem 2352
#include<stdio.h>
#define num 15002
int x[num],y[num];
int hash[num];
int a[32002];
int n;
int main()
{
    freopen("input.txt","r",stdin);
    int i,j,sum;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d%d",&x[i],&y[i]);
        sum=0;
        for(j=0;j<=x[i];j++)
            sum+=a[j];
        a[x[i]]++;
        hash[sum]++;
    }
    for(i=0;i<n;i++)
        printf("%d\n",hash[i]);
}

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