Блог пользователя Tom--CCS

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

Recently in Educational Codeforces round 46 I wrote the following programme for 1000E - Нужно больше боссов in Java:

39737014

Now I am pretty sure that the program runs in O(n + m) time(it is a dfs plus an iteration over the edges). However, the program got rejected due to Time Limit Exceeded despite its optimal asymptotic efficiency. Would anyone point out which part of my programme is consuming lots of time? I am a newbie in programming and really appreciate any help!

Update: Thank you all for giving me advice! I have solved the problem.

Полный текст и комментарии »

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