TLE on SPOJ FASTFLOW

Правка en1, от sherewillpower, 2017-07-03 15:55:01

I am trying to learn Dinic's algorithm to find max flow for a given graph. However my implementation for the same is timing out for the 11th pretest for the question FASTFLOW on SPOJ whatever I do. It's been a day and I haven't been able to find the fault. Please can anyone help me optimize my code further?

Link to question : http://www.spoj.com/problems/FASTFLOW/

My code: http://ideone.com/7FFYRy

Any help would be appreciated, Thank you.

Теги spoj, fastflow

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский sherewillpower 2017-07-03 15:55:01 472 Initial revision (published)