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

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

I was solving tourists problem on kattis and keep on getting WA ,I can't understand what I am doing wrong.Here is a link to my code.The problem is asking for the sum of all paths between such vertex pair (x,y) where y>x and y%x is zero.

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

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

Assume that the tree is 1-2-...-200000. There are multiples of i, including i itself, in the range [1, 200000]. Therefore, each i adds to the answer. , so ans overflows.