WA in USANBOLT

https://www.codechef.com/viewsolution/28571890

Please either format your code or link to your submission - the forum software has mangled it and it won’t compile! :slight_smile:

while(t--){
    ld n,f,db,ta,bs;
    cin>>f>>db>>ta>>bs;
    ld tb = f/bs;
    ld tt = sqrt((2*(f+db))/ta);
    //cout<<tb<<" "<<tt<<endl;
    if(tt<=tb){
        cout<<"Tiger\n";
    }
    else
        cout<<"Bolt\n";

}

My AC code :

https://www.codechef.com/viewsolution/28574008

Cant find any difference between the codes :frowning:

Bro, in question it is mentioned all four values are integer. Why u took all as double ? Just explain that.

One big difference is that in your solution, all the arithmetic is floating point, whereas in @sagar2702’s, it is integral.

The expression:

tt=sqrt((x+y)*2/a);

will probably have very different values depending on whether x, y and a are doubles or ints.

2 Likes

Because it is not integer division

1 Like

Even I have the same issue,idk why is it wrong
https://www.codechef.com/viewsolution/28594600

Change from t1 < t2 to t1 <= t2

I am new to programming, after submitting I am getting NZEC error.
Don’t know where is the problem.
https://www.codechef.com/viewsolution/28991521