jiraiya_777's blog

By jiraiya_777, history, 4 years ago, In English

Hello Codeforces,

I was solving this problem on hackerrank.

I successfully solved it in (O(nlogm)) by submitting this (for hackkerank site). All test cases passed.

But this submission (for hackkerank site) (O(n+m)) passes all but fails this test case. Why??

Also when i try to implement the above solutions on my computer they run indefinitely on other test cases(which got accepted on hackerrank) for large values of n and m.

Help!!

Note- I have already solved the question in O(nlog(m)), so i tried for O(n+m) and this solution passed all but 1 test case.

I need help in knowing what's wrong with the 2nd approach.

  • Vote: I like it
  • -8
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

The test case says access denied. So can you please post the test case instead of the link.
I solved it using upper bound vector. Just removing duplicates and finding the score's position in the array will suffice.

code