結果

問題 No.274 The Wall
ユーザー eitaho
提出日時 2015-08-30 20:02:44
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 355 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,392 KB
最終ジャッジ日時 2024-07-18 15:41:31
合計ジャッジ時間 1,554 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 14 WA * 8
権限があれば一括ダウンロードができます

ソースコード

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