# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3885 |
3 | jqdai0815 | 3682 |
4 | Benq | 3580 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3506 |
7 | ecnerwala | 3505 |
8 | Radewoosh | 3457 |
9 | Kevin114514 | 3377 |
10 | gamegame | 3374 |
# | User | Contrib. |
---|---|---|
1 | cry | 170 |
2 | Um_nik | 162 |
3 | -is-this-fft- | 161 |
3 | atcoder_official | 161 |
5 | djm03178 | 157 |
6 | Dominater069 | 156 |
7 | maomao90 | 155 |
8 | adamant | 154 |
9 | luogu_official | 153 |
10 | awoo | 152 |
Name |
---|
Sum can be 1e14 which would lead to overflow you can set a upperlimit of 1e9
The maximum value that a long long variable can have is $$$2^{63} - 1$$$. In your code
sum
can be equal to $$$2 \cdot 10^{14}$$$ in some test cases and thusmid * mid
may get bigger than the long long limit.In worst case, the sum can be 2*10^14 then the mid will be 10^14. mid * mid will be 10^28. long long can hold at most 10^18.