結果

問題 No.675 ドットちゃんたち
ユーザー silversmithsilversmith
提出日時 2018-11-24 02:19:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,275 ms / 2,000 ms
コード長 512 bytes
コンパイル時間 600 ms
コンパイル使用メモリ 10,768 KB
実行使用メモリ 70,840 KB
最終ジャッジ日時 2023-08-26 04:45:11
合計ジャッジ時間 12,600 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
29,760 KB
testcase_01 AC 118 ms
29,716 KB
testcase_02 AC 115 ms
29,808 KB
testcase_03 AC 118 ms
29,768 KB
testcase_04 AC 120 ms
29,944 KB
testcase_05 AC 1,218 ms
68,668 KB
testcase_06 AC 1,240 ms
70,840 KB
testcase_07 AC 1,116 ms
66,860 KB
testcase_08 AC 1,275 ms
68,748 KB
testcase_09 AC 1,251 ms
70,712 KB
testcase_10 AC 1,239 ms
68,768 KB
testcase_11 AC 1,211 ms
68,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

N,P_x,P_y=list(map(int,input().split()))
R=[None]*N
dot=[np.array([P_x,P_y,1]).T]*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,dot[N-1-i])

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