結果
| 問題 |
No.675 ドットちゃんたち
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-11-21 09:29:58 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 499 bytes |
| コンパイル時間 | 90 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 35,840 KB |
| 最終ジャッジ日時 | 2024-07-23 15:26:32 |
| 合計ジャッジ時間 | 5,058 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 3 WA * 5 |
ソースコード
N, Px, Py = map(int, input().split())
C = [tuple(map(int, input().split())) for _ in range(N)]
res = []
x, y = Px, Py
orient = ((1, 0), (0, 1), (-1, 0), (0, -1))
i = 0
for c in reversed(C):
if c[0] == 1:
x += orient[i][0] * c[1]
y += orient[i][1] * c[1]
elif c[0] == 2:
x += orient[(i + 1) % 4][0] * c[1]
y += orient[(i + 1) % 4][1] * c[1]
else:
x, y = y, -x
i = (i - 1) % 4
res.append((x, y))
for xy in reversed(res):
print(*xy)