ATCODER BEGINNER CONTEST 061

Revision en1, by i_love_sharapova, 2020-07-19 09:54:33

i was solving problem D-SCORE ATTACK of ABC 061 and i tried implementing classic bellman ford algorithm by changing the weight to -ve weight ,so as if any negative cycle occurs then that means score will be continuously increasing but i am getting WA ,i don't know where i am making mistake and i have assumed that graph is connected so either my assumption is wrong or i am implementing wrong algorithm .please can you guys help ? sorry if my english is bad.

here is my code

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English i_love_sharapova 2020-07-19 09:54:33 1308 Initial revision (published)