Скоро Codeforces Round 1133 (Div. 1, Div. 2)! Регистрация здесь. ×

Блог пользователя ash_ketchum

Автор ash_ketchum, история, 11 лет назад, По-английски

Well hello guys! Below is the link to my source code for the above problem. http://codeforces.me/contest/614/submission/15376824 I am getting a WRONG_ANSWER on test case 3 after my submission on CodeForces but when I compiled and executed the testcase on my g++ compiler it gave the right answer.Can anyone please tell me why is this happening?!.Below is a screenshot of the answer that I got for testcase 3 after compiling on g++. (http://codeforces.me/predownloaded/4d/2c/4d2c56826166cb8597ec2f5249162eb3266b58b4.png)

  • Проголосовать: нравится
  • -8
  • Проголосовать: не нравится

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

You shouldn't use the function pow, its return type is double. For example it may return 2.99999999 and when you cast it to int it becomes 2, while the answer actually should be 3

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

In some cases, you have an overflow because the resulting value of k is greater than the upper limit of unsigned long long.

»
11 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

.