반응형
문제
SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
swexpertacademy.com
🐍파이썬
T = 10
for test_case in range(1, T + 1):
tc = int(input())
data = list(map(int, input().split()))
i = 1
while True:
if i > 5:
i = 1
data.append(data.pop(0)-i)
if data[7] <= 0:
data[7] = 0
break
i += 1
print("#{} {} {} {} {} {} {} {} {}".format(tc, *data))
T = 10
for test_case in range(1, T + 1):
_ = int(input())
arr = [i for i in list(map(int, input().split()))]
i = 1
while True:
a = arr.pop(0)-i
if a <= 0:
arr.append(0)
break
else:
arr.append(a)
i += 1
if i > 5:
i = 1
print("#{} {}".format(test_case, ' '.join(map(str, arr))))
반응형
'Problem Solving > SWEA' 카테고리의 다른 글
[SWEA|파이썬] 1860. 진기의 최고급 붕어빵 (D3) (0) | 2023.05.13 |
---|---|
[SWEA|파이썬] 2814. 최장 경로 (D3) (2) | 2023.05.12 |
[SWEA|파이썬] 1216. [S/W 문제해결 기본] 3일차 - 회문2 (D3) (8) | 2023.05.11 |
[SWEA|파이썬] 1220. [S/W 문제해결 기본] 5일차 - Magnetic (D3) (0) | 2023.05.10 |
[SWEA|파이썬] 2817. 부분 수열의 합 (D3) (0) | 2023.05.09 |
[SWEA|파이썬] 1209. [S/W 문제해결 기본] 2일차 - Sum (D3) (0) | 2023.05.09 |