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

Gleb_017 Test 9 - Crash (access violation)! [4] // Problem 1001. Reverse Root 14 Oct 2009 02:20
#include <math.h>
#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
        __int64 a;
    int i=0;
    double b[32768];
    while (cin>>a)
    {
        b[i]=sqrt(double(a));
        i++;
    }
        i--;
    for (int k=i; k>-1; k--)
        cout<<fixed<<setprecision(4)<<b[k]<<'\n';
        return 0;
}
Igor9669(Tashkent IAC) Re: Test 9 - Crash (access violation)! [3] // Problem 1001. Reverse Root 14 Oct 2009 10:25
Increase the size of array!
Gleb_017 Re: Test 9 - Crash (access violation)! [2] // Problem 1001. Reverse Root 14 Oct 2009 22:28
I've already tryed to increase to 100000 and got the same error...
make your array global.
Or use linker directive increasing stack size - the instructions are in FAQ.
Mohsen Biglari Re: Test 9 - Crash (access violation)! // Problem 1001. Reverse Root 21 Oct 2009 00:25
increase it to 150,000 !!!