In question C of Codeforces round #728 Div 2, my submission passed the pretests but failed system tests on test case 11 which is same as the sample test case. How is this possible?
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3803 |
2 | jiangly | 3707 |
3 | Benq | 3627 |
4 | ecnerwala | 3584 |
5 | orzdevinwang | 3573 |
6 | Geothermal | 3569 |
6 | cnnfls_csy | 3569 |
8 | Radewoosh | 3542 |
9 | jqdai0815 | 3532 |
10 | gyh20 | 3447 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | awoo | 163 |
2 | adamant | 161 |
3 | maomao90 | 160 |
4 | maroonrk | 152 |
5 | -is-this-fft- | 151 |
6 | nor | 149 |
7 | atcoder_official | 147 |
7 | SecondThread | 147 |
9 | TheScrasse | 146 |
10 | Petr | 144 |
In question C of Codeforces round #728 Div 2, my submission passed the pretests but failed system tests on test case 11 which is same as the sample test case. How is this possible?
Название |
---|
Bruh...
pre[0] = a[0];
pre[1] = a[1];
should obviously give RTE for n = 1. Idk why it didnt give RTE on 1st case lol.
If I'm not wrong then you have a line written like vll pre(n) ... Basically size is 1 if n is 1 , Now few lines after you are writing pre[1] = a[....] Which is not possible when size is 1 . So it gives a runtime error when n = 1
In pretests n=1 was the last case so even after the runtime your answers were printed correct so the solution was lucky enough to pass the pretest but in #11 that's not the case bcz n=1 is at the top .
Auto comment: topic has been updated by rupinderg00 (previous revision, new revision, compare).
[DELETED]
When you coding sometimes you don't have to worry much about memory limit, that's why you may wanna spare some space in array/vector to avoid FST in the future.
I think he knows his mistake and its correction. He needs the explaination why this didn't fail on the sample test 1 and why the same sol failed on test 11 while both test cases are same just there is difference in the ordering.
I am not sure why this occurred. This is strange. May be spryzen_v3 is correct.
Yeah now I just think again and it's weird when the author has test 11 in reverse compare to test 1, but still, it's even weirder when his solution passed the first test.