|
|
back to boardCommon BoardTo MARAT BAKIROV or someone else from timus..... I think, something's wrong with your test programs.Have a look at program 1203...I got it accepted using PASCAl. Here is the same algorithm, written on C++.Will you, please, give me contra test - that my program get's "Wrong Answer"??? I could not get accepted with this source.... HEre it is.. ------------------------------------------ #include <stdio.h> const int max=30001; const long max2=100001; long a[max]; int x[max2]; void main(){ int y; long n,br,i; for(i=0;i<max;i++) a[i]=0; scanf("%ld",&n); for(i=0;i<n;i++){ scanf("%d%d",&x[i],&y); if (a[y]==0) a[y]=i+1; else if(x[a[i]-1]<x[i]) a[y]=i+1; } br=0; y=0; for(i=0;i<max;i++) if (a[i]) if(x[a[i]-1]>y) {br++;y=i;} printf("%ld\n",br); } ------------------------------------------------------- THANK YOU!!!!! |
|
|