ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1028. Stars

No subject
Posted by hhh 12 Mar 2009 19:29
#include <iostream>
using namespace std;
int n,i, j=0,s=0; int*x,*y,*a;
int main()
{
cin>>n;
x=new int[n]; y=new int[n]; a=new int[n];
for(i=0; i<n; i++) a[i]=0;
for(i=0; i<n; i++) cin>>x[i]>>y[i];
while(j<n) { s=0;
 for(i=0; i<j; i++) { if(x[i]<=x[j]) s++; }
a[s]++; j++; }
for(i=0; i<n; i++) cout<<a[i]<<endl;
delete []x;  delete []y; delete []a;
return 0; }
tl#13
Re: No subject
Posted by Alex Tolstov 13 Mar 2009 14:18
bgg. use tree =)
Re: No subject
Posted by hhh 2 Apr 2009 21:42
i dont know tree, pls tell me about   that