結果
問題 |
No.274 The Wall
|
ユーザー |
|
提出日時 | 2023-10-28 20:23:58 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 685 bytes |
コンパイル時間 | 460 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 77,732 KB |
最終ジャッジ日時 | 2024-09-25 16:34:34 |
合計ジャッジ時間 | 3,326 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 14 WA * 8 |
ソースコード
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][0] and used[j]: ok = False if ok: for j in range(m): if m - 1 - lr[i][1] <= j <= m - 1 - lr[i][0]: used[j] = True continue print("NO") exit() print("YES")