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 1001. Reverse Root

1001 с++ Wrong Answer! WTF??
Posted by s0L 21 Jul 2011 18:25
#include <iostream>
#include <string>
#include <vector>
#include <cmath>

int main(int argc, char* argv[])
{
    const int max_input_size = 256*1024;
    int input_size = 0;
    bool start_digits = false;
    std::vector<unsigned long long> values;

    char c = 0;
    while (!std::cin.eof() && input_size < max_input_size)
    {
        ++input_size;

        std::cin.get(c);
        if (isdigit(c))
        {
            if (start_digits)
            {
                values.back() *= 10;
                values.back() += (c - '0');
            }
            else
            {
                start_digits = true;
                values.push_back(c - '0');
            }
        }
        else start_digits = false;
    }

    std::cout.setf(std::ios::fixed);
    std::cout.precision(4);

    for (std::vector<unsigned long long>::reverse_iterator it = values.rbegin(); it != values.rend(); ++it)
    {
        std::cout << sqrt((long double)*it) << std::endl;
    }

    return 0;
}

What the fuck?!

Test 3, Time 0.15, Mem 184Kb

Task's author, please, move your hands from ass!
Re: 1001 с++ Wrong Answer! WTF??
Posted by Humoyun 1 Oct 2011 20:12
O'zingni bos bacha