結果

問題 No.274 The Wall
ユーザー titiatitia
提出日時 2022-09-13 02:40:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 538 ms
コンパイル使用メモリ 87,240 KB
実行使用メモリ 77,172 KB
最終ジャッジ日時 2023-08-20 04:58:42
合計ジャッジ時間 5,215 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
71,436 KB
testcase_01 AC 108 ms
75,724 KB
testcase_02 AC 94 ms
75,932 KB
testcase_03 AC 120 ms
76,904 KB
testcase_04 AC 76 ms
71,492 KB
testcase_05 AC 73 ms
71,456 KB
testcase_06 AC 74 ms
71,176 KB
testcase_07 AC 74 ms
70,924 KB
testcase_08 AC 72 ms
70,920 KB
testcase_09 AC 73 ms
71,500 KB
testcase_10 AC 78 ms
76,048 KB
testcase_11 AC 109 ms
76,872 KB
testcase_12 AC 98 ms
76,916 KB
testcase_13 AC 83 ms
75,728 KB
testcase_14 AC 108 ms
76,992 KB
testcase_15 AC 107 ms
77,056 KB
testcase_16 AC 120 ms
77,172 KB
testcase_17 AC 123 ms
77,108 KB
testcase_18 AC 122 ms
77,068 KB
testcase_19 AC 116 ms
76,984 KB
testcase_20 AC 116 ms
76,728 KB
testcase_21 AC 98 ms
77,096 KB
testcase_22 AC 99 ms
77,088 KB
testcase_23 AC 106 ms
77,128 KB
testcase_24 AC 103 ms
76,728 KB
testcase_25 AC 98 ms
77,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())
A=[0]*M

for i in range(N):
    l,r=map(int,input().split())

    for j in range(l,r+1):
        A[min(j,M-1-j)]+=1

if M%2==0:
    if max(A)<=2:
        print("YES")
    else:
        print("NO")

else:
    if max(A)<=2 and A[M//2]<=1:
        print("YES")
    else:
        print("NO")

    
0