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 |
1000ms挤过。。#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator