My issue
According to the sample input in the question my output should be Bolt Tiger. But it is Tiger Bolt and I can’t identify the mistake.
My code
#include <iostream>
using namespace std;
int main()
{
int T;
cin>>T;
for(int j=1; j<=T; j++)
{
int finish, distancetoBolt,tigerAccelaration,boltSpeed;
float timeb, timet;
cin>>finish;
cin>>distancetoBolt;
cin>>tigerAccelaration;
cin>>boltSpeed;
timeb = finish*1.0/boltSpeed;
timeb = (timeb * timeb * 1.0);
timet = ((distancetoBolt+finish)*2.0/tigerAccelaration);
if (timeb>timet)
{cout<<" Bolt "; }
else
{cout<<" Tiger ";}
}
return 0;
}
Problem Link: USANBOLT Problem - CodeChef