728x90
반응형

단순 구현 문제이다.

m, n = map(int, input().split())
print("satisfactory" if m >= 8 else "unsatisfactory")

사실 m이 8 이상이면 satisfactory 8 미만이면 unsatisfactory 출력하는게 끝인데

아래 코드 같이 삽질을 하기도 했다. 아래 코드도 통과된다.

m, n = map(int, input().split())
check = 0
for _ in range(m):
    a, b, c = map(int, input().split())
    a = 1 if a > 0 else 0
    b = 1 if a > 0 else 0
    c = 1 if a > 0 else 0    
    if (not a or b or c) and (not a or not b or c) and (a or not b or c) \
        and (a or not b or not c) and (a or b or c) and m >= 8:
        check = 1
print("satisfactory" if check else "unsatisfactory")
728x90
반응형

+ Recent posts