Handling large input file like that given in FB Hackercup problem D

How to handle input file of 10mb+ given in FB Hackercup.
I was using:
freopen(“running_on_fumes_chapter_1_input.txt”, “r”, stdin);
freopen(“output.txt”, “w”, stdout);

I think it was a runtime error that happened but still I am pretty angry and sad that there is no second chance to submit. If anyone uses anyother method which is better please share. Thanks.

no issues just use this -

ifstream cinn("input_fileName.txt");
ofstream coutt("output_fileName.txt");

// read like this - 

cinn>>x;

//output like this -

coutt<<x;

Runtime error in TC 16. I feel you bro :sob: