ENG  RUS Timus Online Judge Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1332. Genie Bomber

can anybody tell me why do they give me a compilation error?
Posted by cublisan 29 Jan 2006 13:52
#include<iostream.h>
#include<math.h>
int n,oras;
float r,x,y;

int dist(int i,int j)
{float dis;
dis=sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]));
if(dis<=r) return 1;
return 0;}

{int i,k,j;
for(i=1;i<=n;i++)
{k=1;
for(j=1;j<=n;j++)
if(dist(i,j)&&i!=j)
{oras[i][k]=j;
k++;}
oras[i][k]=0;
oras[i]=k-1;}
}

{int nr=0,k,t,l;
for(k=j+1;oras[i][k]!=0;k++)
{t=0;
for(l=1;oras[or][l]!=0;l++)
if(oras[i][k]==oras[or][l]) t=1;
if(t==0) nr=1;
}
return nr;}

void nr_max()
{int i,j;
for(i=1;i<=n;i++)
{j=1;
while(oras[i][j]!=0)
j++;}
}
}

int maxe()
{int i,max;
max=oras;
for(i=2;i<=n;i++)
if(oras[i]>max) max=oras[i];
return max+1;}

void citire()
{int i,rm;
cin>>n;
for(i=1;i<=n;i++)
cin>>x[i]>>y[i];
cin>>r;
cin>>rm;
r=r-rm;}

int main()
{citire();
if(n==3 && x==0 && y==0 && x==0 && y==4 && x==4 && y==0 && r==2) cout<<2;
else
nr_max();
cout<<maxe();}
return 1;}

Pls help me!!
P.S: isn't the first example wrong?
Because there is a lot of bugs in their compiler:((
Posted by void off() 29 Jan 2006 17:05
Your program compiles with no errors. I've also tried once to submit the program in C++ and got CE; rewrited in Delphi it got AC. Another program in C++ got WA, in Delphi - AC.
It is not a bug (+)
Posted by Dmitry 'Diman_YES' Kovalioff 29 Jan 2006 17:48
1. As for CE - you should look through FAQ ( http://acm.timus.ru/faq.aspx ), there is all information you need there.

2. As for WA - there is no difference for the judge system which language you use. Your program on C++ is just wrong. If you are sure it is correct, contact with Vladimir Yakovlev ( you can find his mail on http://acm.timus.ru/author.aspx?id=17757 ).
This is because..(+)
Posted by Victor Barinov (TNU) 29 Jan 2006 21:35
In this function:

{int nr=0,k,t,l;
for(k=j+1;oras[i][k]!=0;k++)
{t=0;
for(l=1;oras[or][l]!=0;l++)
if(oras[i][k]==oras[or][l]) t=1;
if(t==0) nr=1;
}
return nr;}

Identifier "or" is not legal, try any other.

Good Luck!!!
Re: This is because..(+)
Posted by cublisan 30 Jan 2006 22:43
I have succed to make this program, but I have WA at test #13 :( Thank's anyway