当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1174:Contact

题目描述
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?

You must help Dr. Insky to find out the truth by providing a tool to analyse bit patterns in the files she records. Dr. Insky wants to find the patterns of length between (and including) A and B that repeat themselves most often in the data file of each day. In each case, the greatest N distinct frequencies (that is, number of occurrences) are sought. Pattern occurrences may overlap, and only patterns that occur at least once are taken into account.
输入解释
Your program is to read from standard input.
First line - The integer A indicating the minimum pattern length.
Second line - The integer B indicating the maximum pattern length.
Third line - The integer N indicating the number of distinct frequencies.
Fourth line - A sequence of 0 and 1 characters, terminated by a 2 character.

The input may have up to 2 megabytes. The parameters A, B and N are constrained by:
0 < N <= 20
0 < A <= B <= 12
输出解释
Your program is to write to standard output. The output contains 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.
输入样例
2
4
10
010100100100010001111011000010100110011110000100100111100100000002
输出样例
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

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 IOI 1998

源链接: POJ-1174

最后修改于 2020-10-29T05:54:50+00:00 由爬虫自动更新

共提交 2

通过率 0.0%
时间上限 内存上限
5000 32768