結果
| 問題 |
No.870 無敵囲い
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-20 21:05:42 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 39 ms / 300 ms |
| コード長 | 664 bytes |
| コンパイル時間 | 211 ms |
| コンパイル使用メモリ | 81,988 KB |
| 実行使用メモリ | 53,796 KB |
| 最終ジャッジ日時 | 2025-03-20 21:05:49 |
| 合計ジャッジ時間 | 1,860 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
# Read the number of moves
n = int(input())
# Initialize positions of A, B, C
a_pos = (2, 8)
b_pos = (3, 9)
c_pos = (7, 9)
for _ in range(n):
x1, y1, x2, y2 = map(int, input().split())
current_from = (x1, y1)
# Check if the move is for any of the tracked pieces
if current_from == a_pos:
a_pos = (x2, y2)
elif current_from == b_pos:
b_pos = (x2, y2)
elif current_from == c_pos:
c_pos = (x2, y2)
# Target positions
target_a = (5, 8)
target_b = (4, 8)
target_c = (6, 8)
# Check if all are in correct positions
if a_pos == target_a and b_pos == target_b and c_pos == target_c:
print("YES")
else:
print("NO")
lam6er