№ | Пользователь | Рейтинг |
---|---|---|
1 | Radewoosh | 3759 |
2 | orzdevinwang | 3697 |
3 | jiangly | 3662 |
4 | Benq | 3644 |
5 | -0.5 | 3545 |
6 | ecnerwala | 3505 |
7 | tourist | 3486 |
8 | inaFSTream | 3478 |
9 | maroonrk | 3454 |
10 | Rebelz | 3415 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | adamant | 172 |
2 | awoo | 165 |
2 | nor | 165 |
4 | SecondThread | 164 |
5 | maroonrk | 162 |
5 | BledDest | 162 |
7 | Um_nik | 161 |
8 | -is-this-fft- | 149 |
9 | Geothermal | 146 |
10 | ko_osaga | 142 |
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.
Why am I getting RE this time?
Название |
---|