본문 바로가기
python-algorithm

백준 20114 미아 노트

by 무적김두칠 2023. 12. 6.

https://www.acmicpc.net/problem/20114

 

20114번: 미아 노트

첫째 줄에 원래 문자열의 길이 N, 세로로 번진 글자의 개수 H, 가로로 번진 글자의 개수 W가 주어진다. (1 ≤ N ≤ 100, 1 ≤ H ≤ 10, 1 ≤ W ≤ 10) 둘째 줄부터 H개의 줄에 걸쳐 N × W 길이의 문자열이

www.acmicpc.net

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
def sol(strings):
    for i in strings:
        if i != '?':
            return i
    return '?'
 
 
n, h, w = map(int, input().split())
alpha = [''* n
for i in range(h):
    s = input()
    for j in range(0len(s), w):
        alpha[j // w] += s[j:j + w]
answer = ''
for i in alpha:
    answer += sol(i)
print(answer)
 
cs
반응형

'python-algorithm' 카테고리의 다른 글

백준 1120 문자열  (1) 2023.12.06
백준 25178 두라무리 휴지  (0) 2023.12.06
백준 17091 단어 시계  (0) 2023.12.06
백준 9324 진짜 메시지  (1) 2023.12.06
백준 7656 만능 오라클  (0) 2023.12.06

댓글