I’m 99% sure that the test cases for the problem MFREQ in the current contest are faulty.
To be more precise, I think that the author’s and tester’s solutions will print elements that appear exactly k times consecutively in the array [L, R] for each query, whereas the description says to output -1, and print the element only if they appear more than k times.
I think this is the case because I wrote a simple brute force solution and it gets AC with >= but WA with >.
This is also why the problem has such a low accuracy and a relatively low amount of successful submissions.
Actually, I just noticed that they have modified the statement. Previously, we have to print element that appears more than K times, but now it has become >=k times. They have not mention changes in the announcement section. So it has created confusion. Hope it helps!
That was REALLY not appreciated. I think they were in a haste to get new problems and stuff…but its still not justified to change description and not announce.
(PS: Why do I get a feeling that they looked at discussion forum and then fixed it? IDK I just get it…)
They didn’t change the test cases, I don’t think, just fixed the description.
But still I’m sure that there are people who gave up on the problem because they kept getting WA with correct algorithms, and now they won’t notice the change in the description because it wasn’t announced.
I noticed this error in the question when I solved it. I did mention the correction in the Comments section, when there was still no update after one day. They seem to have updated the problem statement now, however, they should have mentioned such a change in the Announcements section.