I do stream after Codeforces rounds on twitch. Stream is mostly about discussions and Korean video editorial on problems. Sometimes I do upsolvings.↵
Today, I was explaining about [1519D](https://mirror.codeforces.com/contest/1519/problem/D). And I found something weird in [my code](https://mirror.codeforces.com/contest/1519/submission/114584990).↵
↵
![ ](https://puu.sh/HCFUj/56f9b9092c.png)↵
↵
When I check even-length substrings, I started outermost iteration with `A[1]` and `A[2]` instead of `A[0]` and `A[1]`. So it does not check the case of changing first two elements. This is a shame. The code passed system test somehow, but I can't allow my wrong code got 'Accepted'.↵
↵
Let's hack this with↵
↵
~~~~~↵
5↵
5 0 0 0 0↵
0 5 0 0 0↵
~~~~~↵
↵
![ ](https://puu.sh/HCFM7/05ad15bd8f.png)↵
↵
Oops, elements should be larger than zero.↵
Then this.↵
↵
~~~~~↵
5↵
5 1 1 1 1↵
1 5 1 1 1↵
~~~~~↵
↵
![ ](https://puu.sh/HCyXM/44784b85e4.png)↵
↵
![ ](https://puu.sh/HCznK/edb26ecada.png)↵
↵
Weak tests. I mean, I'm weaker.↵
↵
If you like to watch the moment of hacking, you can check [the video](https://www.youtube.com/watch?v=wUfb6OhC8Mc). ↵
(In video, I say words like "Why this passed the test?" in Korean.)
Today, I was explaining about [1519D](https://mirror.codeforces.com/contest/1519/problem/D). And I found something weird in [my code](https://mirror.codeforces.com/contest/1519/submission/114584990).↵
↵
![ ](https://puu.sh/HCFUj/56f9b9092c.png)↵
↵
When I check even-length substrings, I started outermost iteration with `A[1]` and `A[2]` instead of `A[0]` and `A[1]`. So it does not check the case of changing first two elements. This is a shame. The code passed system test somehow, but I can't allow my wrong code got 'Accepted'.↵
↵
Let's hack this with↵
↵
~~~~~↵
5↵
5 0 0 0 0↵
0 5 0 0 0↵
~~~~~↵
↵
![ ](https://puu.sh/HCFM7/05ad15bd8f.png)↵
↵
Oops, elements should be larger than zero.↵
Then this.↵
↵
~~~~~↵
5↵
5 1 1 1 1↵
1 5 1 1 1↵
~~~~~↵
↵
![ ](https://puu.sh/HCyXM/44784b85e4.png)↵
↵
![ ](https://puu.sh/HCznK/edb26ecada.png)↵
↵
Weak tests. I mean, I'm weaker.↵
↵
If you like to watch the moment of hacking, you can check [the video](https://www.youtube.com/watch?v=wUfb6OhC8Mc). ↵
(In video, I say words like "Why this passed the test?" in Korean.)