import copy
for t in range(10):
lenn = int(input()) # 원본 암호문 길이
text = list(map(str,input().split())) # 원본 암호문
inst_n = int(input()) # 명령어 개수
inst = list(map(str,input().split())) # 명령어
x = int(inst[1]) # x의 자리에
y = int(inst[2]) # y개의 숫자 삽입
inst_index = 3 # 숫자
now = 3 # 다음 반복문을 가리킴
for i in range(inst_n):
for j in range(y):
text.insert(x,inst[inst_index]) # 숫자 추가
x = x + 1 # 다음 자리 지정
inst_index +=1
now += 1
if i < inst_n-1:
x = int(inst[now+1])
y = int(inst[now+2])
now += 3
inst_index = copy.deepcopy(now)
print('#%d'%(t+1),end=' ')
for i in range(10):
if i < 9:
print(text[i],end = ' ')
else:
print(text[i])
'problem solving' 카테고리의 다른 글
3456. 직사각형 길이 찾기 (0) | 2019.09.29 |
---|---|
2805. 농작물 수확하기 (0) | 2019.09.29 |
1240. [S/W 문제해결 응용] 1일차 - 단순 2진 암호코드 (0) | 2019.09.28 |
1213. [S/W 문제해결 기본] 3일차 - Strin (0) | 2019.09.28 |
1234. [S/W 문제해결 기본] 10일차 - 비밀번호 (0) | 2019.09.28 |
댓글