結果

問題 No.769 UNOシミュレータ
ユーザー face4
提出日時 2018-12-17 14:54:16
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 756 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2024-11-22 08:48:23
合計ジャッジ時間 7,646 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding on smartphone
n, m = map(int, input().split())

a = [0] * n
d2 = 0
d4 = 0
turn = 0
di = 1

for i in range (m):
	s = input()
	
	if d2 > 0 :
		if s == "drawtwo":
			d2 += 1
			a[turn] += 1
			turn = (turn+di+n)%n
			continue
		else:
			a[turn] -= 2*d2
			d2 = 0
			turn = (turn+di+n)%n
			
	if d4 > 0 :
		if s == "drawfour":
			d4 += 1
			a[turn] += 1
			turn = (turn+di+n)%n
			continue
		else:
			a[turn] -= 4*d4
			d4 = 0
			turn = (turn+di+n)%n
			
	a[turn] += 1
	
	if s == "drawtwo":
		d2 += 1
	elif s == "drawfour":
		d4 += 1
	elif s == "skip":
		turn = (turn+di+n)%n
	elif s == "reverse":
		di *= -1
		
	turn = (turn+di+n)%n
	
turn = (turn - di + n)%n

print(str(turn+1) + " " + str(a[turn]))
0