結果

問題 No.675 ドットちゃんたち
ユーザー basscl_sugibasscl_sugi
提出日時 2018-06-18 20:03:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,544 ms / 2,000 ms
コード長 743 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 11,072 KB
実行使用メモリ 53,180 KB
最終ジャッジ日時 2023-09-13 06:55:13
合計ジャッジ時間 11,852 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,248 KB
testcase_01 AC 17 ms
8,236 KB
testcase_02 AC 16 ms
7,988 KB
testcase_03 AC 17 ms
8,208 KB
testcase_04 AC 18 ms
8,304 KB
testcase_05 AC 1,427 ms
47,068 KB
testcase_06 AC 1,494 ms
50,008 KB
testcase_07 AC 1,348 ms
48,584 KB
testcase_08 AC 1,486 ms
51,944 KB
testcase_09 AC 1,486 ms
53,180 KB
testcase_10 AC 1,511 ms
53,004 KB
testcase_11 AC 1,544 ms
53,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
def mul(a,b):
    tmp=[[0,0,0],[0,0,0],[0,0,0]]
    for i in range(3):
        for j in range(3):
            for k in range(3):
                tmp[i][j]+=a[i][k]*b[k][j]
    return tmp

def mul_v(a,b):
    tmp=[0,0,0]
    for i in range(3):
        for j in range(3):
            tmp[i]+=a[i][j]*b[j]
    return tmp
n,px,py=map(int,input().split())
d=[]
for i in range(n):
    s=input()
    if s=='3':
        d.append([[0,1,0],[-1,0,0],[0,0,1]])
    elif s[0]=='1':
        d.append([[1,0,int(s.split()[1])],[0,1,0],[0,0,1]])
    else:
        d.append([[1,0,0],[0,1,int(s.split()[1])],[0,0,1]])
for i in range(len(d)-1):
    i=len(d)-1-i
    d[i-1]=mul(d[i],d[i-1])
for i in range(n):
    print(*mul_v(d[i],[px,py,1])[:2])
0