Watched the Hint video also but couldn't figure out why it is giving wrong answer

Please try this https://ide.codingblocks.com/s/256476

@aryan_007 using this
#ifndef ONLINE_JUDGE

 freopen("input.txt", "r", stdin);`
 freopen("output.txt", "w", stdout);

 freopen("error.txt" , "w" , stderr);

 #endif

in this problem is causing you error . removing this will get you AC.

Yes sir , This worked but why this happened ?? because if not defined judge condition was there :thinking: :thinking: Btw thankyou so much sir , many TA’s just handed me their code saying i was wrong , by not even looking at my code , at least you looked at my code and resolved my problem . Thank you so much sir .

1 Like

@aryan_007 maybe test cases are not saved at the specific location from where our freeopen() will read file or maybe due to ide issue thats why it is giving wrong answer using this

Okay sir , Thank you sir for resolving this , many questions were stuck due to this problem !! Thank you sir

1 Like

happy to help :v:, let me know if you have any further queries else mark this doubt as resolved.

1 Like

Yaa sir , sure doubt is solved !! If i had option i would have given 10 stars but my bad their is only option of 5 stars :sweat_smile: