|
|
вернуться в форумIf you have WA#21 Послано JTim 30 сен 2007 01:56 input: -3 3 2 2 1 2 2 1 output: 2 Re: If you have WA#21 your test is wrong 'cause A must be >=0 Re: If you have WA#21 This tests can help you: 1 3 2 2 1 2 2 1 1 1 3 1 1 2 2 2 1 1 Re: If you have WA#21 Послано ... 9 мар 2010 21:39 This tests can help you: 1 3 2 2 1 2 2 1 1 1 3 1 1 2 2 2 1 1 I think, that your test's are not correct.Second line must contain f(1),f(2),f(3) and no more. Re: If you have WA#21 Послано ... 9 мар 2010 23:39 Try tests: 1 9 1 2 1 2 3 2 1 2 1 4 1 10 1 2 1 2 1 0 1 2 1 2 5 1 7 1 2 1 2 1 0 1 5 My solution is greedy. One boolean, one counter and list of nonrecurring array of numbers, but i think, that we can work with numbers during reading. Nice problem :) Re: If you have WA#21 > 1 7 > 1 2 1 2 1 0 1 > 5 How can that be true? (1, 2), (1, 2), (1, 0), (1) - this means, that answer should be 4. |
|
|