Viewing other problems with insights similar to only this insight from Codeforces 1146C: Tree Diameter:

When doing a bitmask problem, consider comparing each bit one at a time. When comparing with two numbers, consider the place where the bits first differ by tester

View links to all pages 1

AboutPrivacy NoticeRulesProblems listJournalYour profileGitHub

Moon Symbol icon by Icons8Sun icon by Icons8 • Emojis from Twemoji by Twitter under CC by 4.0