結果
問題 | No.274 The Wall |
ユーザー |
|
提出日時 | 2023-10-28 19:09:02 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 685 bytes |
コンパイル時間 | 361 ms |
コンパイル使用メモリ | 82,584 KB |
実行使用メモリ | 77,332 KB |
最終ジャッジ日時 | 2024-09-25 16:33:00 |
合計ジャッジ時間 | 3,778 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 WA * 9 |
ソースコード
n, m = map(int, input().split()) lr = [tuple(map(int, input().split())) for _ in range(n)] used = [False] * m for i in range(n): ok = True for j in range(m): if lr[i][0] <= j <= lr[i][1] and used[j]: ok = False if ok: for j in range(m): if lr[i][0] <= j <= lr[i][1]: used[j] = True continue ok = True for j in range(m): if m - 1 - lr[i][1] <= j <= m - 1 - lr[i][1] and used[j]: ok = False if ok: for j in range(m): if m - 1 - lr[i][1] <= j <= m - 1 - lr[i][1]: used[j] = True continue print("NO") exit() print("YES")