結果

問題 No.274 The Wall
ユーザー H3PO4H3PO4
提出日時 2020-06-09 08:33:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 151 ms / 2,000 ms
コード長 258 bytes
コンパイル時間 507 ms
コンパイル使用メモリ 10,588 KB
実行使用メモリ 29,868 KB
最終ジャッジ日時 2023-09-04 02:51:12
合計ジャッジ時間 6,148 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 142 ms
29,624 KB
testcase_01 AC 141 ms
29,636 KB
testcase_02 AC 141 ms
29,672 KB
testcase_03 AC 148 ms
29,716 KB
testcase_04 AC 143 ms
29,756 KB
testcase_05 AC 142 ms
29,600 KB
testcase_06 AC 142 ms
29,656 KB
testcase_07 AC 140 ms
29,688 KB
testcase_08 AC 143 ms
29,600 KB
testcase_09 AC 145 ms
29,700 KB
testcase_10 AC 144 ms
29,668 KB
testcase_11 AC 147 ms
29,772 KB
testcase_12 AC 150 ms
29,820 KB
testcase_13 AC 144 ms
29,696 KB
testcase_14 AC 141 ms
29,868 KB
testcase_15 AC 140 ms
29,692 KB
testcase_16 AC 147 ms
29,664 KB
testcase_17 AC 150 ms
29,736 KB
testcase_18 AC 151 ms
29,780 KB
testcase_19 AC 149 ms
29,720 KB
testcase_20 AC 149 ms
29,760 KB
testcase_21 AC 149 ms
29,752 KB
testcase_22 AC 149 ms
29,764 KB
testcase_23 AC 151 ms
29,672 KB
testcase_24 AC 151 ms
29,792 KB
testcase_25 AC 148 ms
29,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

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

Acc = np.cumsum(lst[:-1])
flag = np.any(Acc + Acc[::-1] > 2)
print('NO' if flag else 'YES')
0