結果
| 問題 | No.274 The Wall |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-08-28 22:45:12 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 29 ms / 2,000 ms |
| + 247µs | |
| コード長 | 534 bytes |
| 記録 | |
| コンパイル時間 | 62 ms |
| コンパイル使用メモリ | 14,976 KB |
| 実行使用メモリ | 11,136 KB |
| 最終ジャッジ日時 | 2026-10-13 08:44:06 |
| 合計ジャッジ時間 | 2,261 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
def read_data():
N, M = map(int, input().split())
LR = []
for n in range(N):
L, R = map(int, input().split())
LR.append((L, R))
return N, M, LR
def solve(N, M, LR):
imos = [0] * (M + 1)
for L, R in LR:
imos[L] += 1
imos[R + 1] -= 1
imos[M - R - 1] += 1
imos[M - L] -= 1
cum = 0
for v in imos:
cum += v
if cum > 2:
return False
return True
N, M, LR = read_data()
if solve(N, M, LR):
print('YES')
else:
print('NO')