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 1200. Horns and Hoofs

Numbers don't have exaclty 2 digits after decimal point!
Posted by Alexey Dergunov [Samara SAU] 25 May 2012 20:49
This code gets WA 1:

long long readLL()
{
    string s;
    cin >> s;
    s.erase(s.find('.'),1);
    stringstream ss(s);
    long long x;
    ss >> x;
    return x;
}

And this code gets AC:

long long readLL()
{
    double d;
    cin >> d;
    return ll(d*100 + 0.0000001);
}