Hello everyone! Lately I stumbled upon a strange issue, when I was solving 1324C - Frog Jumps. I usually wrap my code with a template (defines etc.), so here is submission 73465768, which is getting runtime error on test 1. However when I rewrote my code without this template it got accepted 73465554! Can anyone explain me why the code with a template gets runtime error?
The real problem with the first submission is not the template; it is reading the number of test cases
t
using the scanf macro#define sc(x) scanf("%d", &x)
after turning off the synchronization between ios_base and stdio usingios_base::sync_with_stdio(false)
. All subsequent callscin >> s
inside the solve() function return an empty string.Check the following output of your code.
https://ideone.com/W7vipx
You just need to replace
sc(t)
in the main() function withcin >> t
.Got it! This is what happens when you copy something without thinking. Thanks a lot!
With pleasure.