結果

問題 No.274 The Wall
ユーザー matsu7874matsu7874
提出日時 2015-08-28 22:38:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 325 bytes
コンパイル時間 460 ms
コンパイル使用メモリ 10,852 KB
実行使用メモリ 8,520 KB
最終ジャッジ日時 2023-09-25 19:13:16
合計ジャッジ時間 2,754 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,916 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 20 ms
7,792 KB
testcase_04 AC 16 ms
7,948 KB
testcase_05 AC 16 ms
7,812 KB
testcase_06 AC 15 ms
7,820 KB
testcase_07 AC 16 ms
7,752 KB
testcase_08 AC 16 ms
7,892 KB
testcase_09 WA -
testcase_10 AC 16 ms
7,800 KB
testcase_11 AC 507 ms
8,232 KB
testcase_12 AC 23 ms
8,316 KB
testcase_13 AC 17 ms
7,904 KB
testcase_14 AC 19 ms
7,872 KB
testcase_15 AC 21 ms
8,356 KB
testcase_16 AC 145 ms
8,520 KB
testcase_17 AC 130 ms
8,480 KB
testcase_18 AC 141 ms
8,440 KB
testcase_19 AC 22 ms
8,372 KB
testcase_20 AC 22 ms
8,412 KB
testcase_21 AC 23 ms
8,300 KB
testcase_22 AC 23 ms
8,460 KB
testcase_23 AC 23 ms
8,256 KB
testcase_24 AC 23 ms
8,408 KB
testcase_25 AC 23 ms
8,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
L = []
R = []
for i in range(N):
    l, r = map(int, input().split())
    L.append(l)
    R.append(r)
w = [0 for i in range(M)]
for i in range(N):
    for j in range(L[i], R[i] + 1):
        w[j] += 1
if all(w[i] + w[M - i - 1] <= 2 for i in range(N)):
    print('YES')
else:
    print('NO')
0