結果
問題 | No.274 The Wall |
ユーザー |
|
提出日時 | 2015-08-28 22:45:12 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 34 ms / 2,000 ms |
コード長 | 534 bytes |
コンパイル時間 | 71 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,136 KB |
最終ジャッジ日時 | 2024-06-22 01:57:20 |
合計ジャッジ時間 | 1,533 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 |
ソースコード
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, LRdef solve(N, M, LR):imos = [0] * (M + 1)for L, R in LR:imos[L] += 1imos[R + 1] -= 1imos[M - R - 1] += 1imos[M - L] -= 1cum = 0for v in imos:cum += vif cum > 2:return Falsereturn TrueN, M, LR = read_data()if solve(N, M, LR):print('YES')else:print('NO')