YocyCraft's blog

By YocyCraft, history, 21 month(s) ago, In English

Problem link: 1796E - Colored Subgraphs

When solving this problem I only know how to solve for a fixed root, and it's better to let a leaf node with smaller distance to the nearest node with degree>=3 to be the root, but I don't know how to choose it. So I sort all leaves by there distance, and try first 40 of them to be the root. I've thought it could fail on some large tests but unexpectedly it got AC. Can someone hack this solution or prove it's correctness?

My submission:195462544

Update: My submission has been hacked

  • Vote: I like it
  • +4
  • Vote: I do not like it

»
21 month(s) ago, # |
  Vote: I like it +8 Vote: I do not like it

40 might be okay. But 8 leaves also work for some reason...?

Submission: 195470681

»
21 month(s) ago, # |
  Vote: I like it 0 Vote: I do not like it

Interested