結果

問題 No.675 ドットちゃんたち
ユーザー Kiri8128Kiri8128
提出日時 2020-09-06 17:44:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 279 ms / 2,000 ms
コード長 582 bytes
コンパイル時間 982 ms
コンパイル使用メモリ 86,868 KB
実行使用メモリ 99,256 KB
最終ジャッジ日時 2023-08-19 14:11:15
合計ジャッジ時間 5,463 ms
ジャッジサーバーID
(参考情報)
judge15 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,316 KB
testcase_01 AC 74 ms
71,104 KB
testcase_02 AC 73 ms
71,260 KB
testcase_03 AC 73 ms
71,344 KB
testcase_04 AC 73 ms
71,388 KB
testcase_05 AC 249 ms
97,520 KB
testcase_06 AC 262 ms
97,164 KB
testcase_07 AC 257 ms
96,700 KB
testcase_08 AC 274 ms
99,256 KB
testcase_09 AC 279 ms
99,116 KB
testcase_10 AC 278 ms
99,056 KB
testcase_11 AC 274 ms
98,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def mult(a, b):
    return (a[0] * b[0] - a[1] * b[1], a[0] * b[1] + a[1] * b[0])
def su(a, b):
    return (a[0] + b[0], a[1] + b[1])

N, px, py = map(int, input().split())
p = (px, py)
X = []
for _ in range(N):
    q = [int(a) for a in input().split()]
    X.append(q)
ANS = []
m = (1, 0)
d = (0, 0)
for q in X[::-1]:
    if q[0] == 1:
        r, s = (1, 0), (q[1], 0)
    elif q[0] == 2:
        r, s = (1, 0), (0, q[1])
    else:
        r, s = (0, -1), (0, 0)
    m = mult(m, r)
    d = su(mult(s, m), d)
    ANS.append(su(mult(p, m), d))

for x, y in ANS[::-1]:
    print(x, y)
0