結果
問題 | No.675 ドットちゃんたち |
ユーザー |
|
提出日時 | 2024-04-12 14:10:11 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 1,820 ms / 2,000 ms |
コード長 | 578 bytes |
コンパイル時間 | 92 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 68,296 KB |
最終ジャッジ日時 | 2024-10-02 22:46:33 |
合計ジャッジ時間 | 18,040 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 8 |
ソースコード
import numpy as npN, Px, Py = map(int, input().split())matrices = []matrix = np.diag([1] * 3)C = [tuple(map(int, input().split())) for _ in range(N)]for cmd in reversed(C):if cmd[0] == 1:matrix = np.dot([[1, 0, 0], [0, 1, 0], [cmd[1], 0, 1]], matrix)elif cmd[0] == 2:matrix = np.dot([[1, 0, 0], [0, 1, 0], [0, cmd[1], 1]], matrix)elif cmd[0] == 3:matrix = np.dot([[0, -1, 0], [1, 0, 0], [0, 0, 1]], matrix)matrices.append(matrix)for matrix in reversed(matrices):x, y = np.dot([Px, Py, 1], matrix)[:2]print(x, y)