dev-onejun / Algorithm-Study

[Since 2019] Algorithm Study
0 stars 1 forks source link

CODEFORCES: 580C - Kefa and Park #14

Open dev-onejun opened 1 year ago

dev-onejun commented 1 year ago

https://codeforces.com/problemset/problem/580/C

dev-onejun commented 1 year ago

Idea

using dfs and count the consecutive vertices which has cat, and pop if the path were out of conditions so that don’t search that path anymore.

dev-onejun commented 1 year ago

https://codeforces.com/contest/580/submission/195526550 -> Wrong answer on test 8

dev-onejun commented 1 year ago

https://codeforces.com/contest/580/submission/195758389 -> Accepted