SEBIHWY - Editorial

//here is simple C++ code
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t–)
{
int s,sg,fg,d,T;
cin>>s>>sg>>fg>>d>>T;
if(sg==fg)
cout<<“DRAW”<<endl;
else
{
float dis=50d;
float v=(dis
6060)/(1000T);
v+=s;
if(fabs(v-sg)<fabs(v-fg))
cout<<“SEBI”<<endl;
else if(fabs(v-sg)>fabs(v-fg))
cout<<“FATHER”<<endl;
else
cout<<“DRAW”<<endl;
}
}
return 0;
}

Can someone please tell me what is wrong. Tried many test cases and works for all but still getting wrong answer
https://www.codechef.com/viewsolution/12641292

@rchandu

I had a look at your code and found this

		 "System.out.println(speed);"

The output CLEARLY says to print only “SEBI” or “FATHER” or “DRAW”

If you print out ANYTHING ELSE, like speed etc. Then the online judge (which is NOT a human) will flag your answer as wrong result. Follow output format closely, as even an extra blank space or full stop or comma will get you a wrong answer

Hope it helps :slight_smile:

Can someone help me here? What is missing in my code? I am getting a WA.
https://www.codechef.com/viewsolution/15176177