Problem 1252 --Encoding

1252: Encoding

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $45$ 正确数量 $38$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签

Given a string containing only 'A' - 'Z', we could encode it using the following method:

1. Each sub-string containing k same characters should be encoded to "kX" where "X" is the only character in this sub-string.

2. If the length of the sub-string is 1, '1' should be ignored.

The first line contains an integer N (1 < = N < = 100) which indicates the number of test cases. The next N lines contain N strings. Each string consists of only 'A' - 'Z' and the length is less than 10000.

For each test case, output the encoded string in a line.

2
ABC
ABBCCC
ABC
A2B3C
wq

推荐代码 查看1252 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$0 $ms] C++是世界上最好的语言 581838 2020-05-05 12:54:23
内存最少[$0 $KB] 千年孤独 569328 2020-03-02 21:28:54
第一AC 邓炜@信息与计算科学142 4295 2016-05-27 13:01:29
第一挑战 邓炜@信息与计算科学142 4290 2016-05-27 12:37:25

赛题来源/所属竞赛 NA N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛