Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

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

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

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

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

»
12 месяцев назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Here is a failing test case:

Input:
1
8
1 1 1 1 1 1 5 6

Your Output:
4

Correct Output:
3

I hope you can see for yourself that choosing $$$k \ge 4$$$ does not work for Alice.