help needed in graph problem

Правка en1, от brucewayne123, 2016-05-31 18:43:44

http://codeforces.me/problemset/problem/437/D i was trying this problem but i dont know why i am getting wrong answer on test 7.. my code outputs some negative value(maybe an overflow error but i checked and wasnt able to found one). please someone look through my code and help.. my submission :- http://codeforces.me/contest/437/submission/18170970 PS:- i matched my solution with some accepted one and my logic is same.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский brucewayne123 2016-05-31 18:43:44 455 Initial revision (published)