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 1011. Conductors

10 lines,got AC :D
Posted by hoan 8 Oct 2010 13:01
#include <cstdio>
void main (){
    int res= 0, a1, a2;
    double p, q;
    scanf ("%lf%lf", &p, &q);
    do{
        res ++,a1= (int)(p* (double)res)/100, a2= (int)(q* (double)res-(1e-7))/100;
    }while (a1== a2);
    printf ("%d\n", res);
}
Re: 10 lines,got AC :D
Posted by Drino 25 Oct 2010 14:23
Edited by author 25.10.2010 14:29

Edited by author 25.10.2010 14:29