vermish77's blog

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

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

| Write comment?
»
16 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

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.