### Eason_AC's blog

By Eason_AC, history, 6 months ago,

All my mistakes since Nov.11, 2020 will be recorded here.

Update at any time.

I hope we all can learn something from it.

Temporarily Notice: Mistakes before Nov.19 (Nov.19 included) has been updated. :)
P.S. Blogger is in UTC+8.

• Number 1
Date: 2020.11.11
Problem: 520D
Mistake: I just want to be quick, but in the code to type a few wrong places.
Wrong submissions: A lot. In order not to occupy the space, it will not be put up.
Lesson: Coding is not only about speed, but also accuracy.

• Number 2
Date: 2020.11.11
Problem: 101D
Mistake: I did not notice that the two-way side needs to use an array of twice the size and got WA on test 2/4.
Wrong submissions: 98105038
Lesson: Undirected graph needs an array of twice the size.

• Number 3
Date: 2020.11.11
Problem: 515E
Mistake: I didn’t notice the data range, so I didn’t use an array of sufficient size. And first it got RE on test 5.
Wrong submissions: 98108947
Lesson: Read the questions three times and mark out the data range and other key information.

• Number 4
Date: 2020.11.12
Problem: 107D
Mistake: Also didn't notice the data range, so I key in $n$ as a 32-bit integer variable. And it got TLE on test 15 first.
Wrong submissions: 98185137
Lesson： The same as Number 3.

• Number 5
Date: 2020.11.13
Problem: 505D
Mistake: I put a statement that should have been outside the for loop inside the for loop and it got WA on test 3...
Wrong submissions: 98252098
Lesson: Be careful when typing code.

• Number 6
Date: 2020.11.18
Problem: 721B
Mistake: I didn't think clearly enough and it got WA many times... Finally, I calmed down and tried again after straightening out my ideas and accepted the problem.
Wrong submissions: A lot. In order not to occupy the space, it will not be put up.
Lesson: Think clearly enough before you type code.

• Number 7
Date: 2020.11.19
Problem: 29A
Mistake: It's not right to make mistakes on such a simple problem... I just used a normal array and didn't take into account that negative results were out of bounds...
Wrong submissions: 98892295
Lesson: Be aware of possible array overruns.

• +39

By Eason_AC, history, 6 months ago,

My idea is to construct each zcy number and add it to the answer directly. Here is my code:

Code for 897B

I submitted this code in C++ / C++11, but it got WA on test 3. However, I submitted it in C++14 / 17 and then accepted the problem. That's quite strange!

Picture below shows all the submissions of this problem by me.

Could anyone tell me if there is any undefined behavior in my code, or, in other words, is there any way to get AC in C++ / C++11?

Thanks so much for answering this question of a newbie!

• +4

By Eason_AC, history, 6 months ago,

RT, in the problem 505E, I use binary search to solve it but it gives me WA on the 5th test :-(

Here is my code: 98239918

I've been debugging this problem for a day, but nothing has changed... Could anyone help?