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.
i think u didnt get it.since the submission window opens for only 6 min ,copy and paste of all the test cases took whole of my time leads to timeout.anyway thanks for the help
thanks it worked thanks a lot
This
Compile it with:
g++ filename.txt -o aExecute and redirect the output with:
./a > output.txt