結果

問題 No.675 ドットちゃんたち
ユーザー rlangevinrlangevin
提出日時 2023-09-14 08:48:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 430 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 87,096 KB
実行使用メモリ 99,100 KB
最終ジャッジ日時 2023-09-14 08:49:03
合計ジャッジ時間 4,227 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,496 KB
testcase_01 AC 82 ms
71,180 KB
testcase_02 AC 67 ms
71,264 KB
testcase_03 AC 68 ms
71,396 KB
testcase_04 AC 74 ms
71,392 KB
testcase_05 AC 227 ms
98,252 KB
testcase_06 AC 241 ms
98,220 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, px, py = map(int, input().split())
C = []
for i in range(N):
    C.append(list(map(int, input().split())))
C.reverse()
n = 0
def rot(x, y):
    return y, -x

ans = []
for c in C:
    if c[0] == 3:
        n = (n + 1) % 4
    elif c[0] == 1:
        px += c[1]
    else:
        py += c[1]

    x, y = px, py
    for _ in range(n):
        x, y = rot(x, y)
    ans.append((x, y))

ans.reverse()
for x, y in ans:
    print(x, y) 
0