結果
| 問題 |
No.769 UNOシミュレータ
|
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-05-01 18:31:24 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 935 bytes |
| コンパイル時間 | 474 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 14,848 KB |
| 最終ジャッジ日時 | 2024-12-24 13:42:15 |
| 合計ジャッジ時間 | 5,295 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 WA * 1 |
ソースコード
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N,M = map(int,readline().split())
LOG = read().decode()
LOG = LOG.replace('number','n')
LOG = LOG.replace('skip','s')
LOG = LOG.replace('drawtwo','2')
LOG = LOG.replace('drawfour','4')
LOG = LOG.replace('reverse', 'r')
LOG = LOG.split()
num = [0] * N
player = -1
dx = 1
draw_2 = 0
draw_4 = 0
for L in LOG:
player += dx
player %= N
if draw_2 and L != '2':
num[player] += 2 * draw_2
draw_2 = 0
player += dx
if draw_4 and L != '4':
num[player] += 4 * draw_4
draw_4 = 0
player += dx
player %= N
num[player] -= 1
if L == 's':
player += dx
elif L == 'n':
pass
elif L == 'r':
dx *= -1
elif L == '2':
draw_2 += 1
elif L == '4':
draw_4 += 1
player %= N
x = -num[player]
print(player+1, x)
maspy