Why do I get the "division by zero" error in this? https://codeforces.me/contest/1183/submission/56306470 I will be more than appreciated if you help me!
| № | Пользователь | Рейтинг |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | Kevin114514 | 3657 |
| 3 | jiangly | 3638 |
| 4 | turmax | 3442 |
| 5 | tourist | 3380 |
| 6 | Um_nik | 3353 |
| 7 | strapple | 3350 |
| 8 | squareOf105 | 3346 |
| 9 | heuristica | 3322 |
| 10 | maroonrk | 3310 |
| Страны | Города | Организации | Всё → |
| № | Пользователь | Вклад |
|---|---|---|
| 1 | Qingyu | 158 |
| 2 | nik_exists | 150 |
| 2 | maspy | 150 |
| 4 | AmShZ | 143 |
| 4 | Um_nik | 143 |
| 6 | Errichto | 139 |
| 7 | adamant | 137 |
| 8 | BledDest | 134 |
| 9 | maroonrk | 133 |
| 10 | qwexd | 130 |
Why do I get the "division by zero" error in this? https://codeforces.me/contest/1183/submission/56306470 I will be more than appreciated if you help me!
| Название |
|---|



hope it help
Yes, I know that.......I am just wondering what caused this problem
maybe it understand the line as
ans[k] % (a[j] != 0)Oh thank you. But I have tried it( add parentheses), but failed
I tried
if(a[j] == 0) return 0;in the for loop it give WA on test 5and diagnose : This application has requested the Runtime to terminate it in an unusual way.
when the statement :
a[i] >= 2ok so you used set in the start so
a[j]might get to 0try to add
if(j >= (int)a.size()) return 0;to the same forit get WA on test 5 instead of RTE
here you go I add the line n = a.size()
see 56307859
Oh I see! a.size() may not be equal to n!!!! THX A Lot!!!