the submission: https://codeforces.net/contest/59/submission/279295434
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3904 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3494 |
8 | Um_nik | 3396 |
9 | gamegame | 3386 |
10 | maroonrk | 3350 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | maomao90 | 164 |
1 | cry | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 159 |
5 | awoo | 158 |
6 | adamant | 157 |
6 | -is-this-fft- | 157 |
8 | nor | 154 |
9 | TheScrasse | 153 |
9 | Dominater069 | 153 |
the submission: https://codeforces.net/contest/59/submission/279295434
Название |
---|
When the length of the string is exactly $$$100$$$,
fgets(s, MAX_LEN, stdin);
reads only these $$$100$$$ characters and not the'\n'
character after the string. Therefore, your code cannot judge the end of the string by checking whether it's'\n'
.thank you! i get it now. i defined MAX_LEN as 101, but fgets reads MAX_LEN-1 which are given 100 chars but not the last entered '\n' and the condition never know when to break which causing the runtime error. the solution got accepted after i updated MAX_LEN as 102, where fgets reads till '\n'