ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1530. Ones and Zeroes

A hint ?
Posted by Yosif Yosifov 20 Feb 2007 01:33
Can someone give me a little hint, please ?
Re: A hint ?
Posted by KIRILL(ArcSTU) 20 Feb 2007 01:44
make 2 sequences (s1 and s2) such that s1[i]+s2[i]<>2
Re: A hint ?
Posted by Ivan Ivanov 20 Feb 2007 12:28
My solution is based on a greedy approach.
Re: A hint ?
Posted by Yosif Yosifov 21 Feb 2007 02:38
Thank you both ! :-)
Re: A hint ?
Posted by svr 21 Feb 2007 09:04
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
Re: A hint ?
Posted by svr 21 Feb 2007 13:57
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
Re: A hint ?
Posted by Soul Reaver 20 Mar 2007 01:04
My program successfully passed all of your test cases, but I still WA3... What can it be???
Re: A hint ?
Posted by svr 20 Mar 2007 08:26
You are need in additional tests
Best if you will create them yourself
Re: A hint ?
Posted by Denis Koshman 14 Jul 2008 01:47
I have only 3 cases
1) attempt to build a >b
2) attempt to build a+1 0
3) build 0 0