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

[백준/파이썬] 32604번 Jumbled Scoreboards

by 현장 2024. 11. 1.

-Code

now_t, now_p = -1, -1
flag = True

for _ in range(int(input())):
    a, b = map(int, input().split())

    if not flag:
        continue

    if now_t > a or now_p > b:
        flag = False
        continue

    now_t, now_p = a, b

print("yes" if flag else "no")