Блог пользователя vermish77

Автор vermish77, история, 5 месяцев назад, По-английски

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://codeforces.net/contest/126/problem/B

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

Please help in this

Полный текст и комментарии »

  • Проголосовать: нравится
  • -1
  • Проголосовать: не нравится

Автор vermish77, история, 17 месяцев назад, По-английски

Please, if anyone can see what is wrong in my submission it is failing on the fourth test case of https://codeforces.net/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://codeforces.net/contest/1749/submission/213695901

Полный текст и комментарии »

  • Проголосовать: нравится
  • +10
  • Проголосовать: не нравится