Tried to solve the last div2 B 1993B - Parity and Sum, my approach happens to be similar to the editorial but some how my solution 274988685 fails, can anyone please enlighten me on what i might be missing?
№ | Пользователь | Рейтинг |
---|---|---|
1 | jiangly | 3976 |
2 | tourist | 3815 |
3 | jqdai0815 | 3682 |
4 | ksun48 | 3614 |
5 | orzdevinwang | 3526 |
6 | ecnerwala | 3514 |
7 | Benq | 3482 |
8 | hos.lyric | 3382 |
9 | gamegame | 3374 |
10 | heuristica | 3357 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 169 |
2 | -is-this-fft- | 165 |
3 | Um_nik | 161 |
3 | atcoder_official | 161 |
5 | djm03178 | 157 |
6 | Dominater069 | 156 |
7 | adamant | 154 |
8 | luogu_official | 152 |
9 | awoo | 151 |
10 | TheScrasse | 148 |
Tried to solve the last div2 B 1993B - Parity and Sum, my approach happens to be similar to the editorial but some how my solution 274988685 fails, can anyone please enlighten me on what i might be missing?
Название |
---|
Add a flag to the loop where you find the number of operations. If you have to use the operation and the number of odds does not change, then it is optimal to use it for the largest even number. Now, the largest odd number is always greater than all the even numbers. Edit the second loop to this:
Thanks a lot bro. I really do not know how this works honestly. Care to explain a little bit more?
you should be executed for writing code like this
What's the problem with how i write code?
The code has few problems which I noticed and did not like.
1. You have used define for some of the most popular and most used operators in C++. You will regret your code writing skill if you have to switch your computer or coding language.
2. You have written multiple statements in a single line. What did you want? A one liner code or just lazy to use Return/Enter key?
3. You have assigned variable names too randomly (At least I wasn't able to figure out their role by their names). Even if you had done in the contest, while asking to debug you should have written the same code but with some meaning in the variable name to make your code easy to debug.
is it his -=, != and so on lol those me, ne ? hahahahhaha