|
+16
For solving D2, you gotta make three key observations: Spoiler |
|
-16
. |
|
On
ycperson →
Disproving the Necessity of IQ/Aptitude in Mastering Competitive Programming, 19 months ago
0
I also agree. I'll be following your progress closely :) |
|
0
Any hints? I didn't submit precisely because I was trying to solve it with math but ultimately got nowhere haha |
|
0
As a prize winner, I really enjoyed the problems. Also, I did receive my prize C: |
|
0
I see what the problem is. Try running your code with the following test case: Your code will probably output E, since you're counting the number one twice, but the answer should be A. I suggest you count the ones separately by storing them on another prefix sum array. |
|
0
You're close. Hint 4 Hint 5 |
|
0
Are you sure the first player will always pick that number? I'd suggest you handle that case separately. Also, keep in mind that, if the amount of times said number appears on the range is odd, one of them will pick it more often. |
|
0
Another hint? |
|
0
It's a classical DP problem. Hint 1 Hint 2 |
|
0
Hint 1 Hint 2 Hint 3 |