Hi , for div 2 500 i just used GP formula approach with error range of +-100 . http://ideone.com/NjEMww It failed on test case (837592744927492746) but on ideone it is giving correct answer ! Can any one please explain why ? Is it bug of topcoder ?
№ | Пользователь | Рейтинг |
---|---|---|
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 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 160 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
8 | Dominater069 | 154 |
8 | nor | 154 |
Hi , for div 2 500 i just used GP formula approach with error range of +-100 . http://ideone.com/NjEMww It failed on test case (837592744927492746) but on ideone it is giving correct answer ! Can any one please explain why ? Is it bug of topcoder ?
Название |
---|
On ideone it prints -1 while the answer should be 930658605474991929.
By the way what magic is this:
if(f(i) - S == (long long )0)
?4) 837592744927492746 Returns: -1 This is what the top coder test case is. Well it is supposed to be same as comparing if f(i)(Limaks operation) is equal to the required sum for the ith number . Could you find the bug ?
The test case is "837592744927492746" and yes, your code returns -1. I doesn't mean that the correct answer is -1.
I guess the mistake is that you don't use integers. You assume that pow() has precision 10 - 16, what isn't true.