About Div4E
here is my submission: 346532153
as you can see in my code I made this in the end, to make sure that this is really the error
if len(ans) != len(set(ans)): print(1 / 0)
but even though, it didn't give me runtime and um getting this
wrong answer points in output are not distinct (test case 189)
Btw, if someone knew my actual bug, plz tell me, I solved this problem already using PQ but I am struggling with its BS sol even I think I wrote the idea correctly
UPD1: I got the bug, it was I didn't check before x inclusively and valid as well as same with other side so I can fill the k
but this doesn't change the fact that the above error I was getting is strange, so I still need to know why I got it








Auto comment: topic has been updated by Mostafa_Alaa99 (previous revision, new revision, compare).
Here is the test you are failing:
Input:
Your Output:
You can notice that you should be printing 20 points, but instead you are only printing 18, the two next points are from the next test, for the judge, it reads 20 points and compare, those 20 points contain duplicates, for your code it only checks the 18 points you printed, those contains no duplicates.
The issue with your solution is since got is equal to 0, is inserts it in the first while loop, in the second loop it finds that it was already inserted so it skips that loop, to fix that you should start the second while loop from last possible index before after and move backwardsm here is how I handled it:
Modified your submission and it got AC: 346539937
Now for the useless nitpicks:
Two spaces identation, cringe
You can just write
assert Falseto get RTE instead ofprint(1/0)Woow, this was so helpful comment, thanks too much I handled the bug too, it just missed to check some other available spaces which are the edges (check UPD1)
Yes, I got that the error was that the size I am outputing is wrong — less than k — but I still think it is not a good msg from them, it really misled me
I think I will always replace my 1 / 0 next time, with this cool assert, it didn't come to my mind before, I was always trying to make something strange like this or print text when they expect numbers ^_^