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

wrong answer c++
Posted by TIU_Ilya 25 Sep 2016 15:31
Я уже просто не понимаю, что не так...
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
    long double arr[100000];
    for (int x = 0; x<100000; x++) {
        cin >> arr[x];
    }
    for (int y = 100000; y--;) {
        arr[y] = sqrt(arr[y]);
        cout << fixed << setprecision(4) << (arr[y]) << endl;
    }
    return 0;
}
Re: wrong answer c++
Posted by ToadMonster 25 Sep 2016 21:57
How did you receive a magic number "100000"?

Task example, for example, contains 4 numbers. Your program should process example.
Re: wrong answer c++
Posted by TIU_Sarexer 25 Sep 2016 22:18
My program processes the example of 4 digits, but still wrong answer
Re: wrong answer c++
Posted by ToadMonster 26 Sep 2016 13:53
> My program
Which one? From the topic start post? It isn't. Please look at
https://ideone.com/AhvmV1
Re: wrong answer c++
Posted by TIU_Sarexer 26 Sep 2016 22:21
Re: wrong answer c++
Posted by ToadMonster 27 Sep 2016 13:31
Could you read task description? It should help a bit.

Amount of numbers in the input isn't fixed. You should read numbers from input until EOF.
By task description maximum input size IN BYTES is 256Kb. You should estimate maximum input size in numbers yourself.