Getting TLE in a graph based Div:2(D) Problem.

Правка en1, от NO..ONE..CARES, 2016-05-03 17:29:45

I am getting Time Limit Exceeded for that problem. If anyone can please help. Thanks in advance :)

My approach: By calling N times BFS i got all pairs shortest path. Then by recursively i took all possible 4 nodes as there is no sub-problems so only backtracking can handle this.

Problem Link: http://codeforces.com/contest/667/problem/D

My solution Link: http://codeforces.com/contest/667/submission/17699475

Теги graph, recursion

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский NO..ONE..CARES 2016-05-03 17:29:45 470 Initial revision (published)