I have solved the question. I am reasonably sure my algorithm is optimal. I am using python. I get TLE on the last sub-task. I feel 1.5 seconds is too little time for Python to solve that case.
Not a single has got the full 100. Most have got 50 like me. I posted regarding this in the question comments several times but I have never really gotten a response there, so I am hoping this will work.
Yes, I could just transform the code into C++, it is pretty straightforward, but since this site supports Python, the time limits should be setup accordingly. Please look into it and if you can re-judge those submissions.
I translated my accepted C++ solution to python and it got TLE. Actually, just reading the input in the last test case gives TLE.
It’s always quite hard to be fair for all languages. I could see a way to try to optimize this solution in python, but I think it is impossible to solve the problems with large input in this kind of languages.
There’s no good solution for this. Increasing the time limit so that Python passes will allow inefficient programs in C/C++ get AC in some problems. Applying different time limits for different languages is also hard to keep it fair and quite time consuming (test all languages).
I know it can be hard to test for all languages but since this is clearly a case where Python won’t pass in time I am hoping the admins might raise the limit. If it doesn’t happen I will probably just submit it in C++ before the contest is over.
Yes, Python gets 3x by default, so for this question C++ gets 0.5s, Python gets 1.5s, but as mogers said above, that is not even enough time for Python to read in the whole thing. You can also change the multiplier for each language for a specific question if needed. Which is what I wanted done in this case.
I don’t think this thing is that difficult to tackle. Once they come to know about such problem, they can check someone’s code and algorithm (if they don’t want to waste time in coding for all languages), if the algorithm is the optimal one they should increase the time limit for that language such that, that code will pass. Automatically all codes in that language with that optimal algorithm will start passing.
Do we have to Choose X from the given L and Rs???
EDIT: If we have [1 5][7 8][0 10] Then placing anywhere between 0 to 10 will blow away 3 kingdoms is it right??? only one move??