結果
| 問題 |
No.769 UNOシミュレータ
|
| コンテスト | |
| ユーザー |
iad_2889
|
| 提出日時 | 2019-05-09 18:42:32 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,145 bytes |
| コンパイル時間 | 128 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 28,928 KB |
| 最終ジャッジ日時 | 2024-11-22 09:19:16 |
| 合計ジャッジ時間 | 7,707 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 WA * 5 |
ソースコード
def get_next(N):
def _(current,reverse):
if reverse:
next = current - 1
if next < 0:
next-=N
else:
next = current + 1
return next % N
return _
N,M = map(int,input().split())
log = [input() for x in range(M)]
players = [0 for x in range(N)]
g_next = get_next(N)
current = -1
reverse = False
d_two = 0
d_four = 0
for card in log:
if current == -1:
current = 0
else:
current = g_next(current,reverse)
if d_two:
if card == "drawtwo":
d_two+=2
else:
players[current]-=d_two
d_two = 0
current = g_next(current,reverse)
if d_four:
if card == "drawfour":
d_four+=4
else:
players[current]-=d_four
d_four = 0
current = g_next(current,reverse)
players[current]+=1
if card == "drawtwo":
d_two+=2
elif card == "drawfour":
d_four+=4
elif card == "skip":
current = g_next(current,reverse)
elif card == "reverse":
reverse^=True
print(current + 1,players[current])
iad_2889