hussieneloy's blog

By hussieneloy, 11 years ago, In English

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 :(

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
11 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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).