結果
問題 | No.274 The Wall |
ユーザー |
![]() |
提出日時 | 2015-12-19 15:11:10 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 17 ms / 2,000 ms |
コード長 | 390 bytes |
コンパイル時間 | 76 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-22 02:07:38 |
合計ジャッジ時間 | 1,091 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 |
ソースコード
inputs = lambda:map(int, raw_input().split())n, m = inputs()L = []for i in xrange(n):l, r = inputs()L.append(min((l, r), (m-1-r, m-1-l)))L.sort()s = 0; t = m-1for l, r in L:if t<s:print "NO"breakif s<=l and r<=t:s = r+1elif s<=m-1-r and m-1-l<=t:t = m-1-r-1else:print "NO"breakelse:print "YES"