結果

問題 No.769 UNOシミュレータ
ユーザー daku9640daku9640
提出日時 2018-12-25 22:59:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 675 bytes
コンパイル時間 257 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,648 KB
最終ジャッジ日時 2024-05-02 00:18:14
合計ジャッジ時間 3,167 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,752 KB
testcase_01 AC 29 ms
10,880 KB
testcase_02 AC 29 ms
10,752 KB
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 29 ms
10,752 KB
testcase_05 AC 31 ms
10,752 KB
testcase_06 AC 31 ms
10,752 KB
testcase_07 AC 30 ms
10,752 KB
testcase_08 AC 30 ms
10,752 KB
testcase_09 AC 35 ms
10,624 KB
testcase_10 AC 34 ms
10,752 KB
testcase_11 AC 34 ms
10,752 KB
testcase_12 AC 79 ms
10,880 KB
testcase_13 AC 80 ms
10,880 KB
testcase_14 AC 80 ms
10,880 KB
testcase_15 AC 130 ms
11,136 KB
testcase_16 AC 132 ms
11,136 KB
testcase_17 AC 132 ms
11,136 KB
testcase_18 AC 182 ms
11,520 KB
testcase_19 AC 182 ms
11,648 KB
testcase_20 AC 183 ms
11,520 KB
testcase_21 AC 178 ms
11,520 KB
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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