?? problem 2478.htm
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0047)http://acm.zju.edu.cn/show_problem.php?pid=2478 -->
<HTML><HEAD><TITLE>Problem 2478</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2800.1491" name=GENERATOR></HEAD>
<BODY>
<CENTER><IMG src="Problem 2478.files/logo.gif" align=center></IMG></CENTER>
<HR>
<CENTER><FONT color=blue size=+2>Encoding</FONT></CENTER>
<HR>
<CENTER><FONT color=green>Time limit:</FONT> 1 Seconds <FONT
color=green>Memory limit: </FONT>32768K </FONT><BR><FONT
color=green>Total Submit:</FONT> 898 <FONT color=green>Accepted
Submit:</FONT> 332 </CENTER>
<HR>
<P>Given a string containing only 'A' - 'Z', we could encode it using the
following method: </P>
<P>1. Each sub-string containing k same characters should be encoded to "kX"
where "X" is the only character in this sub-string.</P>
<P>2. If the length of the sub-string is 1, '1' should be ignored.</P>
<P><BR><B>Input</B></P>
<P>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 100.</P>
<P><BR><B>Output</B></P>
<P>For each test case, output the encoded string in a line.</P>
<P><BR><B>Sample Input</B></P>
<P>2<BR>ABC<BR>ABBCCC</P>
<P><BR><B>Sample Output</B></P>
<P>ABC<BR>A2B3C<BR></P>
<P><BR><B>Author: </B><I>ZHANG, Zheng</I> </P>
<HR>
<CENTER><A href="http://acm.zju.edu.cn/submit.php?pid=2478">Submit</A>
<A href="http://acm.zju.edu.cn/list_problem.php?vol=15">Back</A>
<A
href="http://acm.zju.edu.cn/problem_status.php?pid=2478">Status</A> </CENTER>
<HR>
<CENTER><A href="http://acm.zju.edu.cn/"><FONT color=red>Zhejiang University
Online Judge</FONT></A> <A href="http://acm.zju.edu.cn/"><FONT
color=red>V1.0</FONT></A><BR></CENTER></BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -