Блог пользователя Seferoglu

Автор Seferoglu, история, 2 года назад, По-английски

Hello CodeForces, today I tried solving the problem from a recent contest: 1923E - Count Paths

My Solution:

Solution

If you see any problems with the code, please let me know as I can't see the problem. If you don't understand a part of the code, please ask and I will clarify.

Submission: 255437477

UPD: The runtime takes more than 30 seconds! So I guess the runtime is O(N^2) somehow.

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

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by Seferoglu (previous revision, new revision, compare).

»
16 месяцев назад, скрыть # |
 
Проголосовать: нравится +14 Проголосовать: не нравится

Your centroid finding code has a bug where it compares the size of its child with the parent, but it should check with the size of the current root.