https://codeforces.net/contest/1364/submission/85603351
pls tell me why the above code shows runtime error on test case 6.
Someone pls correct this code
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3856 |
2 | jiangly | 3747 |
3 | orzdevinwang | 3706 |
4 | jqdai0815 | 3682 |
5 | ksun48 | 3591 |
6 | gamegame | 3477 |
7 | Benq | 3468 |
8 | Radewoosh | 3462 |
9 | ecnerwala | 3451 |
10 | heuristica | 3431 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 168 |
2 | -is-this-fft- | 162 |
3 | Dominater069 | 160 |
4 | Um_nik | 159 |
5 | atcoder_official | 156 |
6 | djm03178 | 153 |
6 | adamant | 153 |
8 | luogu_official | 149 |
9 | awoo | 148 |
10 | TheScrasse | 146 |
https://codeforces.net/contest/1364/submission/85603351
pls tell me why the above code shows runtime error on test case 6.
Someone pls correct this code
Название |
---|
You could assert that the set is not empty here
auto it = s_minus_sq.begin();
before dereferencing it.Yeah, that's working thanks!
But I think that the condition never arrives at which s_minus_sq.size() is 0 and control is at else if . That's why I haven't checked that condition.
Can you tell me what lead you to that?
The Checker Diagnostics looks like access to "bad" memory, and I did not see any other line of suspicious code.