본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 5753번 Pascal Library

by 현장 2025. 1. 10.

-Code

while True:
    n, d = map(int, input().split())

    if n == d == 0:
        break

    attend = [0] * n

    for _ in range(d):
        x = list(map(int, input().split()))
        for i in range(n):
            if x[i]:
                attend[i] += 1

    print("yes" if d in attend else "no")