hello everyone.i want to know how to save my output file in cpp to submit in ongoing fb hackercup contest .i tried to submit my first sollution but it lead to timeout since i tried to copy paste my output file in a text file .i need your help to submit my sollution.thanks for your help..
Include these lines in your code:-
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
Although there is no reason I could think for timeout when you copy-paste the output.These lines just takes the input from the file input.txt and stores the output in output.txt.Maybe you need to check your code again.
This
Compile it with:
g++ filename.txt -o a
Execute and redirect the output with:
./a > output.txt