Silly to ask, but reallly irritating
source link: http://codeforces.com/blog/entry/101742
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
My solution to the problem 1665C - Tree Infection : 153109990 gives WA on test6 and i am unable to find the corner case . If possible, please help correcting my solution
In general, your solution fails whenever there are multiple highest elements where element-bs-1==0 inside the priority queue. while that particular top element is finished, the other top elements are not and still have a value of 1. (eg. multiple 2s, bs=1) Here's a counterexample demonstrating this:
1 1 1 1 2 2 2 2 2
(Answer should be 5)
If you remove the line that handles this, your solution should work.
Recommend
-
23
Join GitHub today GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software togethe...
-
21
Code is a powerful means of self-expression. Building things because they’re useful is great. Purely ridiculous coding proje...
-
7
Ask HN: Co-founder wants me to leave but won't entertain a buy out offer Ask HN: Co-founder wants me to leave but won't entertain a buy out offer 85 points by
-
3
Questions I Want to Ask, but Can’t The perfect interview coding problem is one that will be easy for a great candidate, hard for a good candidate, and impossible for everyone else. Unfortunately, most of the problems you come up...
-
8
IT Modernization: Ask Not Why, But Why Not?While cost and efficiency are likely the centerpieces of any company's push towards IT modernization, the other benefits can be hugely important to getting the green light....
-
8
Is It Worth Repairing a 2017 iMac With Frequent, Irritating and Undiagnosable Kernel Panics?
-
6
Mac Studio Owners Complain of Irritating High-Pitched Noise MacRumors macrumors bot...
-
4
Ask HN: Boring but important tech no one is working on
-
3
Home Chevron icon...
-
6
Ask HN: Lead developer but I just don't enjoy management
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK