a041: Decompression 解壓縮
標籤 : String 字串
通過比率 : 70% (7 人 / 10 人 ) (非即時)
評分方式 :
Tolerant

最近更新 : 2019-03-04 10:41

內容

A compressed string consists of any number of pairs, where each pair consists of (number, pattern). A pattern can be a sub-string with any length, e.g., “ab”. The number designates the number of repetition of the pattern. This assignment is to decompress the compressed string. For example, we will decompress “3ab” into “ababab”.

一段壓縮過的字串由任意數量的配對所組成,其中每對由(數字, 樣版)所組成。樣版可以是具有任何長度的子字串,例如“ab”。數字表示樣版的重複次數。這樣的設定用於解壓縮字串。例如,我們將“3ab”解壓縮為“ababab”。

輸入說明

The input file consists of a number of strings, where each string is separated by a newline. Each compressed string is known to be less than 1024 characters. However, the decompressed string will be longer than 1024bytes.

輸入文件由許多字串組成,其中每個字串由換行符號分隔。 已知每個壓縮字串少於1024個字元。 但是,解壓縮的字串將有可能長於1024字元。

輸出說明

Save the decompressed strings into a specified output file.

將解壓縮的字串保存到指定的輸出中。

範例輸入
2a3bc
範例輸出
aabcbcbc
測資資訊 :
記憶體限制 : 64 MB
隱藏 測資點#0 (50%): 1.0s , <1K
隱藏 測資點#1 (50%): 1.0s , <1K
提示 :
標籤:
String 字串
出處:
線上協同學習平臺 - ITSA 教育部資通訊軟體創新人才推升計畫 [編輯 :
zero_jason (zero_jason(MANAGER))
]


編號 身分 題目 主題 人氣 發表日期
沒有發現任何「解題報告」