結果
| 問題 | No.769 UNOシミュレータ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-03-08 11:05:45 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,478 bytes |
| 記録 | |
| コンパイル時間 | 485 ms |
| コンパイル使用メモリ | 85,636 KB |
| 実行使用メモリ | 83,024 KB |
| 最終ジャッジ日時 | 2026-03-08 11:05:50 |
| 合計ジャッジ時間 | 4,872 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 WA * 1 |
ソースコード
N,M = map(int, input().split())
A = [0]*(N+1)
turn = 1
forward = 1
cnt2 = 0
cnt4 = 0
def nextTurn():
global turn,forward
if forward==1:
turn += 1
if turn>N:
turn -= N
else:
turn -= 1
if turn==0:
turn = N
def draw2():
global cnt2,turn,forward
A[turn] += cnt2
cnt2 = 0
nextTurn()
def draw4():
global cnt4,turn,forward
A[turn] += cnt4
cnt4 = 0
nextTurn()
for i in range(M):
s = input().strip()
if s=="number":
if cnt2>0:
draw2()
if cnt4>0:
draw4()
A[turn] -= 1
nextTurn()
elif s=="drawtwo":
if cnt4>0:
draw4()
A[turn] -= 1
cnt2 += 2
nextTurn()
elif s=="drawfour":
if cnt2>0:
draw2()
A[turn] -= 1
cnt4 += 4
nextTurn()
elif s=="skip":
if cnt2>0:
draw2()
if cnt4>0:
draw4()
A[turn] -= 1
if forward==1:
turn += 2
if turn>N:
turn -= N
else:
turn -= 2
if turn<=0:
turn += N
elif s=="reverse":
if cnt2>0:
draw2()
if cnt4>0:
draw4()
A[turn] -= 1
forward *= -1
nextTurn()
if forward==1:
ind = turn-1
if ind==0:
ind = N
else:
ind = turn+1
if ind==N+1:
ind = 1
print(ind,-A[ind])