본문 바로가기
SWEA 문제 풀이

SWEA[D2] 1946. 간단한 압축 풀기 python 멋진 풀이

by ODEU 2022. 7. 15.
728x90

SWEA[D2] 1946. 간단한 압축 풀기 python 풀이입니다.

 

https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PmkDKAOMDFAUq&categoryId=AV5PmkDKAOMDFAUq&categoryType=CODE&problemTitle=1946&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=&pageSize=10&pageIndex=1 

 

SW Expert Academy

SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!

swexpertacademy.com


업데이트되어 더욱 간결하고 빠른 버전으로 돌아왔습니다.

 

T = int(input())
for tc in range(1, T + 1):
    N = int(input())
    cnt = 0
    print(f'#{tc}')
    for i in range(N):
        C, K = input().split()
        K = int(K)
        for j in range(K):
            print(C, end='')
            cnt += 1
            if cnt == 10:
                print()
                cnt = 0
    print()

아름답네요...

728x90