I'm getting runtime error again and again and i can't seem to find any issue with my code as codeforces custom test compiler is also printing output just fine but when i submit code i get runtime error plz help, these 1 are questions that i'm getting issue with. 1. 120B - Quiz League 178911312
I suggest that you learn about Undefied Behaviour. On C++ there are some (actually many) operations for which there is not a guaranteed behaviour for all environments. As the C++ committee is not the ones who make compilers, nor ones who make computer architectures, they can't enforce it for every existing compiler or architecture, otherwise it would be a real pain deciding what behaviour is effective for every environment. Thus, they put it as an undefined behaviour, so you cannot ensure them to work the way you expected on every environment.
i am not a pro but i think this question wants input and output from a file. so write this after main function is declared :
and then when you submit your code, it will throw a time limit exceeded error, which i think you can solve on your own by changing your program.
Modified submission — 179137435
Didn't notice that — you're right. Maybe I forgot that back in the old contests, using STDIN/STDOUT was not very common (or at least that was the case for Korea until 2014)
179140457 why do i getting output not found now, and i can't see why i'm getting tle in your submission
In this case we do not want the
#ifndef
, we want the File I/O to run on the online judge. You can change it to#ifdef
instead.Thanks it works, so whenever i have to solve old questions do i have to use this? cause i never encounter this issue till now even solving beta contests from the codeforces beginning why do i get this issue now?
Under the time/memory limits there were two lines input:input.txt, output:output.txt so I think you can use File I/O whenever you see this.