Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

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

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

Hi Everyone, I am currently stuck at this problem : https://mirror.codeforces.com/contest/1253/problem/D

AC code : https://mirror.codeforces.com/contest/1253/submission/271988149

TLE code : https://mirror.codeforces.com/contest/1253/submission/272003978

I am trying to solve it by using DSU. My solution is getting accepted when I am sorting the edges in descending order. The only difference is that I have removed the sort in the code which is giving TLE.

My understanding is that ordering of edges should not matter for this problem and I also don't think the issue is DSU operations because I am using the union by rank.

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

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