ah yes! My solution gave NO where answer is 1010. Thanks a lot
This is exactly how TESTER’S SOLUTION proceeds. But it is clear that once we find good fit for first question mark we don’t need to consider any further possibilities for it.
Your solution fails for the following case, number of colors = 2, arrangement = “1”. The answer should be “1”, where as your solution outputs “0”.
This test is incorrect. A real failing test is
1
0
But this is easy bug. Another much more important bug you can catch on the following test
2
??1?
1
0
gives 0
and
2
??1?
gives 1010
Is this wrong??
@kaush_adm: k=1 s=1 does not follow the input constraints.
At first sight your solution should fail on these tests. So if not you can take any AC solution and compare its output with yours for random tests.
http://www.codechef.com/viewsolution/1120092
@admin can you please tell on which test case my solution failed
http://www.codechef.com/viewsolution/1120092
@admin. please provide me with test case on which my solution failed
thanks in advance
Hey, your test fails on this :
1
2
??1
This should give “NO” but yours gives 021 which is incorrect. You are missing out on using the k in the question properly.
I think this was giving me a few wrong answers initially
https://www.codechef.com/viewsolution/28823773
can you pls see and point out on which of the test cases its failing
It fails for e.g.
1
1
???0?0??0??0?0?
Your output has question marks in it!
https://www.codechef.com/viewsolution/28824985
see i have resolved it but it still showing WA.
Consider the testcase:
1
5
1
XD
1
1
0?