So I was doing THOUSES Problem - CodeChef question and even though my approach was correct and exactly matched with editorial, I was getting Runtime Error (SIGSEGV) on test case 3. Having recently known that declaring global array can fix this issue, I tried it still got RE. I even copy pasted Tester’s solution and still getting same RE on tc 3. Even copy pasted some solutions in comment section of the editorial (which claimed that they worked earlier, even then they are showing RE now)! I always faced one or another issue with codechef compiler, while such things never happened in Codeforces, which gave me yet another reason that Codeforces is better than Codechef.
My solution: CodeChef: Practical coding for everyone
A solution found in comment section which worked earlier: CodeChef: Practical coding for everyone
The same code (copy pasted) now giving Runtime Error: