Problem Link:(http://codeforces.me/contest/548/problem/B) My Code
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
Problem Link:(http://codeforces.me/contest/548/problem/B) My Code
Название |
---|
first we can't see what problem you are talking about because the link goes to your submissions but if you talk about this submission the answer is simple .... your code is O(n * m * q) which is too much for this problem as n*m*q = 1250000000
Why this is accepted?
tbh i just think that this step has saved him
a[x][y]=1-a[x][y];
instead of putting ifs
he should have gotten timelimit. To solve the question you should have added an array which keeps maximum contiguos 1's in each row.
And update the row that gets changed.To get complexity of O(n+m)q);
Thank you.ggok