http://codeforces.me/contest/449/submission/14705739
on my system the output for the given test case is coming to be "2" , while codeforces compiler is giving "1" .
why so?
http://codeforces.me/contest/449/submission/14705739
on my system the output for the given test case is coming to be "2" , while codeforces compiler is giving "1" .
why so?
| № | Пользователь | Рейтинг |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | Kevin114514 | 3659 |
| 3 | jiangly | 3640 |
| 4 | turmax | 3450 |
| 5 | tourist | 3408 |
| 6 | strapple | 3360 |
| 7 | Um_nik | 3354 |
| 8 | squareOf105 | 3348 |
| 9 | maroonrk | 3312 |
| 10 | idontwannadothis…e | 3191 |
| Страны | Города | Организации | Всё → |
| № | Пользователь | Вклад |
|---|---|---|
| 1 | Qingyu | 155 |
| 2 | nik_exists | 151 |
| 3 | maspy | 149 |
| 4 | AmShZ | 145 |
| 5 | Um_nik | 143 |
| 6 | Errichto | 139 |
| 7 | BledDest | 136 |
| 8 | adamant | 135 |
| 9 | maroonrk | 133 |
| 10 | cry | 130 |
| Название |
|---|



I doubt anybody will read your submission with such formatting
No need to read the code when tools can detect the problem.
Compiling with
-fsanitize=undefinedshows errorit means memory corruption, uninitialized memory or out of bound access.
Compiling with
-D_GLIBCXX_DEBUGshowsmost likely this is case 3. out of bound access. Replacing
[]withatconfirms it.thanks