http://mirror.codeforces.com/contest/460/submission/7541409
When i run the code on my machine, it gives the correct output whereas here it shows different
http://mirror.codeforces.com/contest/460/submission/7541409
When i run the code on my machine, it gives the correct output whereas here it shows different
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | strapple | 3515 |
| 6 | tourist | 3470 |
| 7 | dXqwq | 3436 |
| 8 | Radewoosh | 3415 |
| 9 | Otomachi_Una | 3413 |
| 10 | Um_nik | 3376 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | adamant | 152 |
| 3 | Proof_by_QED | 146 |
| 3 | Um_nik | 146 |
| 5 | Dominater069 | 144 |
| 6 | errorgorn | 141 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 9 | TheScrasse | 134 |
| Name |
|---|



First,
with help of Taylor series. It is not 100% accurate, for example,
pow(x, y)on GNU C++ 4.7 compiler calculates something likepow(5, 2)may return something like25.0000000000001or24.9999999999999. So you can write your own function that calculates xy for integer x and y, or you can useroundfunction. Also some C++ compilers provide overloadpow(double, long long), which will work as intended, because it is binary exponentiation and double type stores integers less than 253 without errors.Second, you declare
dasint, but 104·815 + 104 > 109, so overflow will happen.And third, you don't check, whether d < 109.
AC: 7545312