Dr. Astro Insky works at a radiotelescope centre. Recently, she noticed a very curious microwave pulsing emission sent right from the centre of the galaxy. Is the emission transmitted by some extraterrestrial form of intelligent life? Or is it nothing but the usual heartbeat of the stars?
2
4
10
010100100100010001111011000010100110011110000100100111100100000002
This asks for the top ten frequencies of patterns of length between two and four that occur in the bit
pattern
01010010010001000111101100001010011001111000010010011110010000000
Note that the fourth line of the input file above appears split in order to fit herein. [Text has
been changed to single column for HTML format] In this example, pattern 100 occurs 12 times, and
pattern 1000 occurs 5 times. The most frequent pattern is 00.
CONTACT.OUT
with at most N lines, listing the at most N greatest frequencies and
corresponding patterns. The listing must be produced in decreasing order of pattern frequency, and
consists of lines formatted like
frequency pattern pattern pattern
where frequency is the number of occurrences of the patterns that follow. The patterns in each line must appear in decreasing order of length. Patterns of equal length must be listed in reverse numerical order. In case there are less than N distinct frequencies, the output listing will have less than N lines.
23 00
15 10 01
12 100
11 001 000 11
10 010
8 0100
7 1001 0010
6 0000 111
5 1000 110 011
4 1100 0011 0001
출처:IOI 98