結果

問題 No.274 The Wall
ユーザー しらっ亭
提出日時 2015-08-29 01:25:06
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 859 ms / 2,000 ms
コード長 322 bytes
コンパイル時間 244 ms
コンパイル使用メモリ 12,160 KB
実行使用メモリ 10,368 KB
最終ジャッジ日時 2025-03-17 18:46:57
合計ジャッジ時間 4,171 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    N, M = list(map(int, input().split()))
    a = [0] * M
    for _ in range(N):
        l, r = list(map(int, input().split()))
        for i in range(l, r + 1):
            a[i] += 1
            a[-1 - i] += 1

    print('YES' if all(ai <= 2 for ai in a) else 'NO')


if __name__ == '__main__':
    solve()
0