본문 바로가기
python-algorithm

백준 11121 Communication Channels

by 무적김두칠 2022. 11. 15.

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

 

11121번: Communication Channels

The first line of the input consists of a single number T, the number of transmissions. Then follow T lines with the input and the output of each transmission as binary strings, separated by a single space. 0 < T ≤ 100 All inputs and outputs has length l

www.acmicpc.net

 

1
2
3
4
5
6
7
8
9
10
11
def sol(origin,changed):
    for i in range(len(origin)):
        if origin[i]!=changed[i]:
            return 'ERROR'
    return 'OK'
 
if __name__ == '__main__':
    t= int(input())
    for i in range(t):
        origin, changed = input().split()
        print(sol(origin,changed))
cs

한 글자만 달라도 에러입니다!
If at least one character is different , ERROR

반응형

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

백준 14626 ISBN  (0) 2022.11.24
백준 25932 Find the Twins  (0) 2022.11.16
백준 8718 Bałwanek  (0) 2022.11.15
백준 7595 Triangles  (0) 2022.11.15
백준 16099 Larger Sport Facility  (0) 2022.11.15

댓글