結果

問題 No.274 The Wall
ユーザー eitahoeitaho
提出日時 2015-08-30 20:02:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 355 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 8,912 KB
最終ジャッジ日時 2023-09-25 19:51:40
合計ジャッジ時間 1,867 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,816 KB
testcase_01 AC 16 ms
7,804 KB
testcase_02 AC 15 ms
7,800 KB
testcase_03 AC 19 ms
8,232 KB
testcase_04 AC 15 ms
7,812 KB
testcase_05 AC 15 ms
7,848 KB
testcase_06 AC 15 ms
7,736 KB
testcase_07 AC 15 ms
7,944 KB
testcase_08 AC 15 ms
7,820 KB
testcase_09 AC 14 ms
7,732 KB
testcase_10 AC 14 ms
7,804 KB
testcase_11 AC 24 ms
8,744 KB
testcase_12 AC 25 ms
8,816 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 25 ms
8,496 KB
testcase_17 AC 24 ms
8,492 KB
testcase_18 AC 24 ms
8,500 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 26 ms
8,800 KB
testcase_23 AC 26 ms
8,752 KB
testcase_24 WA -
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, W = map(int, input().split())
segments = []

for i in range(N):
    L, R = map(int, input().split())
    segments.append([R, L, i])
    segments.append([W - 1 - L, W - 1 - R, i])
segments.sort()
x = -1
used = [0] * N
for R, L, i in segments:
    if not used[i] and L > x:
        used[i] = 1
        x = R

print("YES" if used.count(0) == 0 else "NO")
0