結果

問題 No.675 ドットちゃんたち
ユーザー silversmithsilversmith
提出日時 2018-11-24 02:04:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,417 ms / 2,000 ms
コード長 506 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 10,760 KB
実行使用メモリ 70,860 KB
最終ジャッジ日時 2023-08-26 04:44:57
合計ジャッジ時間 13,440 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
29,796 KB
testcase_01 AC 133 ms
31,364 KB
testcase_02 AC 133 ms
29,748 KB
testcase_03 AC 131 ms
29,852 KB
testcase_04 AC 132 ms
29,748 KB
testcase_05 AC 1,395 ms
70,860 KB
testcase_06 AC 1,417 ms
70,772 KB
testcase_07 AC 1,277 ms
64,772 KB
testcase_08 AC 1,411 ms
68,968 KB
testcase_09 AC 1,401 ms
68,856 KB
testcase_10 AC 1,402 ms
70,672 KB
testcase_11 AC 1,415 ms
68,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

N,P_x,P_y=list(map(int,input().split()))
R=[None]*N
dot=[None]*N
for i in range(N):
	ope=list(map(int,input().split()))
	if ope[0]==1:
		R[i]=np.array([[1,0,ope[1]],[0,1,0],[0,0,1]])
	elif ope[0]==2:
		R[i]=np.array([[1,0,0],[0,1,ope[1]],[0,0,1]])
	else:
		R[i]=np.array([[0,1,0],[-1,0,0],[0,0,1]])

ope=np.eye(3)
for i in range(N):
	ope=np.dot(ope,R[N-1-i])
	dot[N-1-i]=np.dot(ope,np.array([P_x,P_y,1]).T)

for i in range(N):
	print(str(int(dot[i].T[0])) + " " + str(int(dot[i].T[1])))
0