WRONG ANSWER

whenever i am submitting the code they are writing it wrong answer but the same code ran in codeblocks without any problem

question link https://www.codechef.com/problems/SEBIHWY

my code

  #include<stdio.h>
    int main()
    {
      int i ;
      scanf("%d",&i);
      while(i--)
      {
        float S,SG,FG,D,T;
        float O,R;
       
        scanf("%f%f%f%f%f",&S,&SG,&FG,&D,&T);
         O=(180*D)/T;
         R=S+O;
        
        if(abs(SG-R)<abs(FG-R))
           {
               printf("SEBI \n");
           }
        else if(abs(SG-R)>abs(FG-R))
            {
            printf("FATHER \n");
            }
        else
            {
            printf("DRAW \n");
            }
      }
      return 0;
    }

Hi. Have you found the answer? If yes please share this info with me because I have the same problems. Thanks in advance.

Try to change abs with fabs.

Difference detected in outputs
---------Failed Test Case----------
3
111 203 22 2 214
56 297 26 5 217
32 221 20 6 60

---------End of Test Case----------
first difference in line 1
+---+----------+---------+
| # | good.cpp | bad.cpp |
+---+----------+---------+
| 1 | SEBI     | DRAW    |
| 2 | FATHER   | FATHER  |
| 3 | FATHER   | FATHER  |
+---+----------+---------+

Use my tool to detect such edge cases : https://github.com/srbcheema1/code_tester

It is easy to use and install. read instructions in README :slight_smile:

//