結果

問題 No.769 UNOシミュレータ
ユーザー daku9640daku9640
提出日時 2018-12-25 22:08:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 691 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-05-02 00:17:32
合計ジャッジ時間 6,803 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 32 ms
10,752 KB
testcase_03 AC 31 ms
10,624 KB
testcase_04 WA -
testcase_05 AC 33 ms
10,752 KB
testcase_06 AC 33 ms
10,624 KB
testcase_07 AC 33 ms
10,624 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 53 ms
10,624 KB
testcase_11 AC 52 ms
10,752 KB
testcase_12 WA -
testcase_13 AC 253 ms
10,752 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 31 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

draw = {"drawtwo":2, "drawfour":4}
def solve():
    n, m = map(int, input().split())
    fi = [0] * n
    se = [0] * n
    cnt = 1
    draw_cnt = 0
    no = 0
    last = ""
    for _ in range(m - 1):
        l = input()
        if l != last and "draw" in last:
            se[cnt] += draw[last] * draw_cnt
            no = (no + cnt) % n
            draw_cnt = 0
        if se[no] == 0:
            fi[no] += 1
        else:
            se[no] -= 1
        if "draw" in l:
            draw_cnt += 1
        elif "skip" == l:
            no = (no + cnt) % n
        elif "reverse" == l:
            cnt *= -1
        no = (no + cnt) % n
        last = l
    print(no + 1, fi[no] + 1)
solve()
0