YocyCraft's blog

By YocyCraft, history, 20 months 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

»
20 months 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

»
20 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Interested