結果

問題 No.675 ドットちゃんたち
ユーザー cielciel
提出日時 2018-09-11 01:11:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,674 ms / 2,000 ms
コード長 348 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 10,820 KB
実行使用メモリ 87,752 KB
最終ジャッジ日時 2023-09-02 08:45:26
合計ジャッジ時間 15,699 ms
ジャッジサーバーID
(参考情報)
judge16 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
29,576 KB
testcase_01 AC 146 ms
29,536 KB
testcase_02 AC 144 ms
29,492 KB
testcase_03 AC 146 ms
29,472 KB
testcase_04 AC 147 ms
29,492 KB
testcase_05 AC 1,622 ms
83,776 KB
testcase_06 AC 1,661 ms
87,668 KB
testcase_07 AC 1,521 ms
82,600 KB
testcase_08 AC 1,616 ms
83,644 KB
testcase_09 AC 1,672 ms
86,540 KB
testcase_10 AC 1,639 ms
87,752 KB
testcase_11 AC 1,674 ms
87,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,numpy
f=lambda:sys.stdin.readline().split()
n,x,y=map(int,f())
a=[[[1,0,c[1]],[0,1,0],[0,0,1]]if c[0]<2 else [[1,0,0],[0,1,c[1]],[0,0,1]]if c[0]<3 else[[0,1,0],[-1,0,0],[0,0,1]]for c in[[int(e)for e in f()]for _ in[0]*n]]
for i in range(n-2,-1,-1):a[i]=numpy.dot(a[i+1],a[i])
for e in a:print(' '.join(map(str,numpy.dot(e,[x,y,1])[:2])))
0