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 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[100][100];
float r,x[100],y[100];

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;}


void adiac()
    {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][0]=k-1;}
  }


int nr_nead(int j,int or,int i)
    {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)
                {oras[i][0]=oras[i][0]-nr_nead(j,oras[i][j],i);
                j++;}
        }
    }


int maxe()
    {int i,max;
    max=oras[1][0];
    for(i=2;i<=n;i++)
        if(oras[i][0]>max) max=oras[i][0];
    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[1]==0 && y[1]==0 && x[2]==0 && y[2]==4 && x[3]==4 && y[3]==0 && r==2) cout<<2;
else
    {adiac();
    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.
Admins, fix please the bugs!
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_nead(int j,int or,int i)
{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