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

Автор Ferrarixxx, история, 4 года назад, По-английски

Hi guys ,
I think the editorial's solution (https://mirror.codeforces.com/blog/entry/78864)
for this (https://mirror.codeforces.com/contest/1367/problem/D) problem is wrong

Proof:
Try this test case :
1
cbazzkjbsdf
3
3 1 0

For the above testcase actual output should have been abc
but according to almost all codes(including editorialist's) its ksz

So am i correct ?? or have i made a mistake in understanding the problem??

I resort to your generous replies.

Thanks in Advance.

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

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

For the input,

1
cbazzkjbsdf
3
2 1 0

"cba" is incorrect. For "cba", the array b can be evaluated as -

b[0] = 0, as there are no characters in cba greater than c.

b[1] = |1 — 2| = 1, as only c is greater than the second character i.e. b.

b[2] = |1 — 3| = 2, similarly as above.

I think you are misinterpreting the problem.

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Codeforces community , Please help me out here

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    abc is also correct for this test

    but try to come up with an idea that would work for every test case (Editorial and other solutions use such an idea).

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

If there are several answers, output any.