Please help, stuck on 339C, getting Wrong answer.

Revision en1, by vasanthaganesh, 2020-04-28 19:29:41

[submission:78249878][submission:78248612][problem:339C]

I've been stuck on this problem. The question says if there are multiple possible answers, print any of them. My answers do not seem to pass. I think they are correct. Can you please tell me why my answers are wrong?

Test case 1:

0000000101
3

My answer:

YES
10 8 10

Wrong answer on test case 4:

Test case 2:

1111111111
1000

My answer:

1 2 3 1 2 1 2...

Thanks in advance, Vasanth.

Tags #dfs and similar, #dp, #graphs, #greedy

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English vasanthaganesh 2020-04-28 19:29:41 578 Initial revision (published)