cpinitiative / usaco-guide

A free collection of curated, high-quality resources to take you from Bronze to Platinum and beyond.
https://usaco.guide
Other
1.6k stars 479 forks source link

Contact Form Submission - Mistake (https://usaco.org/index.php?page=viewproblem2&cpid=763) #4729

Closed maggieliu05 closed 2 weeks ago

maggieliu05 commented 2 weeks ago

Someone submitted the contact form!

URL: https://usaco.guide/dashboard/ Module: https://usaco.org/index.php?page=viewproblem2&cpid=763 Topic: Mistake Message: I don't know if this is just me but the official solution is incorrect and the solution given in the guide.

In the code y'all have initially set the total number of cows that produce the initial g milk to be N. but N is not the number of cows in the problem, N is given as the number of entries in the log!

So because the last test case involves only 1 cow being updated 2 times, the wall never changes. The answer is supposed to be 0. but it's given as 1.

If you submit the same code to the bronze problem, except setting g initially to be 7 and change the variable type of the id from int to string, you will get the first test case wrong. But if you do it my way, which is setting the total number of cows to be the number of ids scanned by all the log entries, you literally get all test cases right for the bronze problem.

bqi343 commented 2 weeks ago

The last test case looks fine to me?

Note that Farmer John has a very large herd of cows, so although some of them are noted in his log book as changing their milk production, there are always plenty of other cows around whose milk output level remains at G gallons.