結果

問題 No.274 The Wall
ユーザー mkawa2
提出日時 2020-02-05 08:41:17
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-22 03:19:28
合計ジャッジ時間 2,189 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 17 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 6)
def MI(): return map(int, sys.stdin.readline().split())

def main():
    n,m=MI()
    b=[0]*(m+1)
    for _ in range(n):
        l,r=MI()
        b[l-1]+=1
        b[r]-=1
    for i in range(m):
        b[i+1]+=b[i]
        if b[i+1]>2:
            print("NO")
            break
    else:
        print("YES")

main()
0