I am quite habituated of getting this error…, “Code.exe has stopped working”. As far as I know, this is nothing but runtime errors. But this time even in the simplest of code, I got this error while the input file which is quite large (the code is for taking input in the problem C of Facebook Hacker Cup). You can download the full grading file from the problem link.
And here is the small code for the input. (Please note that this is not the solution code. This code is written only for taking inputs and just checking the source of this error.)
#include<bits/stdc++.h> using namespace std; int main() { #ifndef ONLINE_JUDGE freopen("timber_input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif int t; cin>>t; for(int test=1;test<=t;test++) { int n; cin>>n; int p[n],h[n]; vector<pair<int,int>> v; for(int i=0;i<n;i++) {cin>>p[i]>>h[i]; v.push_back(make_pair(p[i],h[i]));} } }
Here’s what Sublime Text 3 says
[Finished in 5.3s with exit code 3221225725] [shell_cmd: g++ "C:\Program Files (x86)\Sublime Text 3\Temp.cpp" -o "C:\Program Files (x86)\Sublime Text 3/Temp" && "C:\Program Files (x86)\Sublime Text 3/Temp"] [dir: C:\Program Files (x86)\Sublime Text 3] [path: C:\Windows\System32;C:\MinGW\bin]
Both the files timber_input.txt and output.txt are in the main folder of Sublime Text 3. Also the C++ file is kept in the same folder.
Could anyone please help me with this.