結果

問題 No.675 ドットちゃんたち
コンテスト
ユーザー H3PO4
提出日時 2024-04-12 14:10:11
言語 Python3
(3.14.3 + numpy 2.4.2 + scipy 1.17.0)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 578 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 666 ms
コンパイル使用メモリ 20,696 KB
実行使用メモリ 64,672 KB
最終ジャッジ日時 2026-02-17 16:19:42
合計ジャッジ時間 22,040 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 5 TLE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import numpy as np

N, 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)
0