What's the reason behind the Runtime Error?
I got a runtime error on the last Atcoder Regular Contest.
The problem is this .
My RE solution here .
I used (char) (k+'0') to convert the digit k to character.
for (int k = 1; k < 7; k++) { if (!f[k]) { ch[i][j] = (char)(k + '0'); break; } }
3 3 ... ... ...
I always wrote (char) ('a'+k)to get the kth letter from the alphabet and didn't get Runtime Error on any platform.
(char) ('a'+k)
Why am I getting RE this time?
Codeforces Round 983 (Div 2) - Solution Discussion