|
|
вернуться в форумCan someone give me a little hint, please ? make 2 sequences (s1 and s2) such that s1[i]+s2[i]<>2 My solution is based on a greedy approach. Thank you both ! :-) I think that an algorithm has many special cases. Main rool:to correct firstly s2[i] from 1 to 0 in pair s1[i]=1 and s2[i]=1 diminishing B but have pair 0, 0 in older position correcting it to 0, 1 for final increasing lexiographicly of B Who can find all cases he solve the problem After getting AC i have counted 6 cases next tests correspong each of cases 4 1011 0011 1011 0100 4 1010 0111 1011 0000 4 1011 0110 1100 0000 4 1111 0101 0000 0000 4 1010 0101 1011 0000 4 1011 0100 1100 0000 Edited by author 21.02.2007 13:58 My program successfully passed all of your test cases, but I still WA3... What can it be??? You are need in additional tests Best if you will create them yourself I have only 3 cases 1) attempt to build a >b 2) attempt to build a+1 0 3) build 0 0 |
|
|