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

建议使用的浏览器:

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

3916:Duplicate Removal

题目描述
The company Al's Chocolate Mangos has a web site where visitors can guess how many chocolate covered mangos are in a virtual jar. Visitors type in a guess between 1 and 99 and then click on a "Submit" button. Unfortunately, the response time from the server is often long, and visitors get impatient and click "Submit" several times in a row. This generates many duplicate requests.
Your task is to write a program to assist the staff at ACM in filtering out these duplicate requests.
输入解释
The input consists of a series of lines, one for each web session. The first integer on a line is N, 0 < N ≤ 25, which is the number of guesses on this line. These guesses are all between 1 and 99, inclusive. The value N = 0 indicates the end of all the input.
输出解释
For each input data set, output a single line with the guesses in the original order, but with consecutive duplicates removed. Conclude each output line with the dollar sign character '$'. Note that there is a single space between the last integer and the dollar sign.
输入样例
5 1 22 22 22 3
4 98 76 20 76
6 19 19 35 86 86 86
1 7
0
输出样例
1 22 3 $
98 76 20 76 $
19 35 86 $
7 $

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

题目来源 Mid-Central USA 2009

源链接: POJ-3916

最后修改于 2020-10-29T07:15:27+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536