I'm so mad that C is wrong because I got the wrong data type!
| № | Пользователь | Рейтинг |
|---|---|---|
| 1 | ecnerwala | 3844 |
| 2 | Benq | 3792 |
| 3 | tourist | 3719 |
| 4 | VivaciousAubergine | 3647 |
| 5 | jiangly | 3616 |
| 6 | ksun48 | 3595 |
| 7 | Kevin114514 | 3491 |
| 8 | strapple | 3486 |
| 9 | Um_nik | 3376 |
| 10 | turmax | 3371 |
| Страны | Города | Организации | Всё → |
| № | Пользователь | Вклад |
|---|---|---|
| 1 | Qingyu | 162 |
| 2 | adamant | 148 |
| 3 | Um_nik | 146 |
| 4 | Dominater069 | 143 |
| 5 | errorgorn | 141 |
| 6 | cry | 138 |
| 7 | Proof_by_QED | 136 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 10 | soullless | 133 |
I'm so mad that C is wrong because I got the wrong data type!
| Название |
|---|



Don't be mad, take it as experience for later contests.
(Yesterday I used the wrong datatype for problem B, submitted and locked the problem immediately without optimizing the code. I was so careless and got TLE on test 9. After finished the contest, I just changed a few lines of code and it was Accepted. What a pity!)
Join the #define int long long cult! Everyone hates us, and they got a point, but this kind of mistake won't ever happen to you again
I think that #define long long long cult is better.
A good way to avoid these mistakes is to do a mental estimation of the upper bound of the absolute value before assigning datatypes. For example, if there's an array with $$$\le 2 \cdot 10^5$$$ elements between $$$-10^9$$$ and $$$10^9$$$, any subset sum of this array will be between $$$\pm 2 \cdot 10^{14}$$$, which clearly needs a 64-bit integer type. I try to be as specific about the bounds as possible, and it helps me verify my implementation as well, so I'd recommend others to do this too.
Me too!