|
|
back to boardWhat can be on WA#4 Posted by Nilrem 23 Oct 2005 00:39 #include <stdio.h> #include <math.h> int main() { float a,b,c; int i; scanf("%f %f %f",&a,&b,&c); i=log(b/a)/log((100-c)/100)+1; printf("%d",i); } it's simple code fails on fourth test... (WA#4) What can it be ? Re: What can be on WA#4 Here is my code: Program Acm_Timus_1283; var i,k0,km:longint; n,log:real; begin Readln(k0,km,n); n:=(100-n)/100; log:=((ln(km)-ln(k0))/ln(n)); i:=trunc(log); if log-trunc(log)>0.0000000001 then inc(i); Writeln(i); end. Wa#4 too((( Re: What can be on WA#4 I had WA4 too. But then found my mistake(noting to do with precision, actually:)). The thing is that if first number is less or equal that the second then 0 should be output. I suo=ppose your program outputs a negative number:) Re: What can be on WA#4 Posted by Ekvilon 10 Oct 2009 04:09 No doubt, if the dwarf has less money than he should have for his life not to be senseless, he doesn't live at all. When I corrected this mistake, i got AC instead WA#4. |
|
|