結果

問題 No.675 ドットちゃんたち
ユーザー cande398
提出日時 2018-06-18 20:29:24
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 546 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 27,392 KB
最終ジャッジ日時 2024-06-30 17:03:40
合計ジャッジ時間 5,336 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 3 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

command = []
rev = False
N, Px, Py = map(int, input().split())
Fx, Fy = Px, Py
for i in range(N):
	command.append(list(map(int, input().split())))
	if command[-1][0] == 1:
		Fx = Fx+command[-1][1]
	elif command[-1][0] == 2:
		Fy = Fy+command[-1][1]
	else:
		rev = not rev
		Fx, Fy = Fy, 0-Fx
for i in range(N):
	print(Fx, Fy)
	if command[i][0] == 1:
		if rev:
			Fy += command[i][1]
		else:
			Fx -= command[i][1]
	elif command[i][0] == 2:
		if rev:
			Fx -= command[i][1]
		else:
			Fy -= command[i][1]
	else:
		Fx, Fy = 0-Fy, Fx
		rev = not rev
0