|
|
back to board1001 с++ 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?? O'zingni bos bacha |
|
|