AC: https://mirror.codeforces.com/contest/1406/submission/92644945 WA :https://mirror.codeforces.com/contest/1406/submission/92645375 why WA ?? LONG_MIN < the value in code??
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
AC: https://mirror.codeforces.com/contest/1406/submission/92644945 WA :https://mirror.codeforces.com/contest/1406/submission/92645375 why WA ?? LONG_MIN < the value in code??
Name |
---|
If you submit in C++17, not C++17(64 bit, msys 2) then your solution is compiled and run in 32bit environment where long is 32-bit type and LONG_MIN = -2147483648
getting same error on C++17(64bit) WA:https://mirror.codeforces.com/contest/1406/submission/92664218
Use LLONG_MIN Here is your Accepted code (modified)
Can you please explain why it fails ??
long longl is always 64 bit, but long depends on the computer that the program is running. In this case, long was 32 bit, so you got WA.
You should have get accepted when you submitted in 64 bit. But may be it's an internal problem of codeforces. So it is better to use
LLONG_MIN
instade ofLONG_MIN