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 1184. Cable Master

Wrong test or checker,Admins please check
Posted by dgorlov 27 Sep 2006 23:56
I use binary search to solve this problem and had trouble
with input
this input gots AC:
   double x;
   int j,t;
        fscanf(inf,"%lf",&x);
        L[i]=(int)(x*100.0+1e-9);
but this got WA9
        fscanf(inf,"%i.%i",&t,&j);
        L[i]=t*100+j;
 output in boyh programs was like this
    fprintf(outf,"%i.%0.2i\n",ANS/100,ANS%100);

possible reasons:
1. input data hasn't 2 digits after decimal point(maybe it have none digits and no point at all)
2. chacker is floating-point written program with do errors
and you have to do the same errors to AC.
Re: Wrong test or checker,Admins please check
Posted by Alias (Alexander Prudaev) 10 Dec 2007 14:59
this code is wrong
fscanf(inf,"%i.%i",&t,&j);
L[i]=t*100+j;

you must use scanf("%d", &x);
instead of scanf("%i", &x);
why ?
try to input "09"
%d reads it as 9, but %i reads some random thing