Hacking my own code on my stream

Правка en1, от Gravekper, 2021-04-30 06:37:01

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. And I found something weird in my code.

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

Oops, elements should be larger than zero. Then this.

5
5 1 1 1 1
1 5 1 1 1

Weak tests. I mean, I'm weaker.

If you like to watch the moment of hacking, you can check the video.
(In video, I say words like "Why this passed the test?" in Korean.)

Теги #livestream

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Gravekper 2021-04-30 06:38:39 60
en1 Английский Gravekper 2021-04-30 06:37:01 1163 Initial revision (published)