vermish77's blog

By vermish77, history, 4 months ago, In English

I think my solution has a time complexity of O(nlogn) as I am doing binary search on answer but it still gives TLE, why is it giving TLE . This is the problem link:- https://mirror.codeforces.com/contest/126/problem/B

This is my solution:- https://mirror.codeforces.com/contest/126/submission/271378723

Please help in this

Full text and comments »

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

By vermish77, history, 16 months ago, In English

Please, if anyone can see what is wrong in my submission it is failing on the fourth test case of https://mirror.codeforces.com/contest/1749/problem/C. I have used the trick that atleast one 1 must be present so the answer cant be greater than the number of 1 and also for each stage if I have a number less than or equal to it. Then if p are the stages in which we won't need help of 1s then the left k-p are the ones that will make 1s get away as they will be used by Alice.So, my answer is p+(k-p+1)/2. This is my approach, please tell me where am I wrong. https://mirror.codeforces.com/contest/1749/submission/213695901

Full text and comments »

  • Vote: I like it
  • +10
  • Vote: I do not like it