A5488 | 「一本通 2.3 练习 1」Immediate Decodability
时间限制1s
内存限制512MB
通过 / 提交0/0
题目描述
**原题来自:ACM Pacific NW Region 1998**
给出一些数字串,判断是否有一个数字串是另一个串的前缀。
给出一些数字串,判断是否有一个数字串是另一个串的前缀。
输入格式
输入数据为多组数据,每组数据读到 $9$ 时结束。
输出格式
对于每组数据,如果不存在一个数字串是另一个串的前缀,输出一行
Set t is immediately decodable ,否则输出一行 Set t is not immediately decodable ,其中 $t$ 是这一组数据的组号。输入输出样例
输入 #1
01 10 0010 0000 9 01 10 010 0000 9
输出 #1
Set 1 is immediately decodable Set 2 is not immediately decodable
原文如下:
>An encoding of a set of symbols is said to be *immediately decodable* if no code for one symbol is the prefix of a code for another symbol. We will assume for this problem that all codes are in binary, that no two codes within a set of codes are the same, that each code has at least one bit and no more than ten bits, and that each set has at least two codes and no more than eight.
数字串只包含 $0,1$,记每个数字串长度为 $l$,则 $1\le l\le 10$。每组数据至少有 $2$ 个数字串,至多有 $8$ 个数字串。
>An encoding of a set of symbols is said to be *immediately decodable* if no code for one symbol is the prefix of a code for another symbol. We will assume for this problem that all codes are in binary, that no two codes within a set of codes are the same, that each code has at least one bit and no more than ten bits, and that each set has at least two codes and no more than eight.
数字串只包含 $0,1$,记每个数字串长度为 $l$,则 $1\le l\le 10$。每组数据至少有 $2$ 个数字串,至多有 $8$ 个数字串。
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?