from sys import stdin scan = lambda : stdin.readline() test = int(scan()) for case in range(1,test+1): text = scan() counter =0 print("Case %d: "%case,end='') for i in range(0,len(text)): if text[i]>='A' and text[i]<='Z': txt = text[i] elif text[i]>='0' and text[i]<='9': counter = (counter*10) + int(text[i]) if i == len(text)-1 or (text[i+1]>='A' and text[i+1]<='Z'): for k in range(1,counter+1): print(txt,end='') counter =0 print()
21 December 2017
UVA 11541 Python solution
Subscribe to:
Post Comments (Atom)
-
Problem Explanation Category: Easy Type: String Ad Hoc This is simple string ad hoc problem. You just need to find out a substring of...
-
#To make a simple gui follow the instructions. You need to at first install PyQt4 in your system. If you use linux run the code sudo apt-ge...
-
It will be easy to solve the problem if you know about the Nim game. " Nim has been mathematically solved for any number of initial...
No comments:
Post a Comment