Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

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

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

I know that The problem is quite easy, but I get WA and I don't know why

problem : https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=4418

my Code : http://ideone.com/GRdOq5

I don't know whether my approach is wrong or I have a bug in my implementation or both :(

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

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

I don't know if this is the only problem, but you have some integer overflow. Try using "long long" (which is 64 bits) instead of "int" (which is 32 bits).