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

Test 9 - Crash (access violation)!
Posted by Gleb_017 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;
}
Re: Test 9 - Crash (access violation)!
Posted by Igor9669(Tashkent IAC) 14 Oct 2009 10:25
Increase the size of array!
Re: Test 9 - Crash (access violation)!
Posted by Gleb_017 14 Oct 2009 22:28
I've already tryed to increase to 100000 and got the same error...
Re: Test 9 - Crash (access violation)!
Posted by melkiy 14 Oct 2009 23:24
make your array global.
Or use linker directive increasing stack size - the instructions are in FAQ.
Re: Test 9 - Crash (access violation)!
Posted by Mohsen Biglari 21 Oct 2009 00:25
increase it to 150,000 !!!