728x90
5753번: Pascal Library
Pascal University, one of the oldest in the country, needs to renovate its Library Building, because after all these centuries the building started to show the effects of supporting the weight of the enormous amount of books it houses. To help in the renov
www.acmicpc.net
문제 풀이
모든 케이스마다 참석한 사람이 한명이라도 존재할 때 "yes"를 출력하고, 아니라면 "no"를 출력해준다.
정답 코드
while True :
lst = [*map(int, input().split())]
if sum(lst) == 0 : break
st = [0] * lst[0]
for _ in range(lst[1]) :
tmp = [*map(int, input().split())]
for i in range(len(tmp)) :
st[i] += tmp[i]
if lst[1] in st : print("yes")
else : print("no")
728x90
'Algorithm > PS' 카테고리의 다른 글
[BOJ/백준] 5949 - Adding Commas [python] (0) | 2023.03.16 |
---|---|
[BOJ/백준] 5789 - 한다 안한다 [python] (0) | 2023.03.16 |
[BOJ/백준] 5691 - 평균 중앙값 문제 [python] (1) | 2023.03.15 |
[BOJ/백준] 5666 - Hot Dogs [python] (0) | 2023.03.15 |
[BOJ/백준] 5356 - Triangles [python] (1) | 2023.03.15 |