Author: | A. Klenin | Time limit: | 2 sec | |
Input file: | input.txt | Memory limit: | 64 Mb | |
Output file: | output.txt |
Let us call a string of digits d1 d2… dk alternating string if the digits on even and odd positions form two disjoint sets.
For example, 121212 and 01234567 are alternating strings, while 11 and 5435 are not.
Your program must, given the string of digits, find its longest continuous alternating substring. If there is more than one longest substring, output the leftmost one.
No. | Input file (input.txt ) |
Output file (output.txt ) |
---|---|---|
1 |
|
|
2 |
|
|