結果

問題 No.769 UNOシミュレータ
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2022-07-10 16:42:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 845 bytes
コンパイル時間 355 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 98,564 KB
最終ジャッジ日時 2023-09-01 23:41:38
合計ジャッジ時間 5,918 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,208 KB
testcase_01 AC 70 ms
71,260 KB
testcase_02 AC 74 ms
71,328 KB
testcase_03 AC 72 ms
71,068 KB
testcase_04 AC 88 ms
75,808 KB
testcase_05 AC 86 ms
75,504 KB
testcase_06 AC 87 ms
75,636 KB
testcase_07 AC 90 ms
75,496 KB
testcase_08 AC 88 ms
75,804 KB
testcase_09 AC 132 ms
77,848 KB
testcase_10 AC 130 ms
77,896 KB
testcase_11 AC 128 ms
77,900 KB
testcase_12 AC 204 ms
82,196 KB
testcase_13 AC 202 ms
82,320 KB
testcase_14 AC 202 ms
81,924 KB
testcase_15 AC 279 ms
89,916 KB
testcase_16 AC 286 ms
90,632 KB
testcase_17 AC 275 ms
91,456 KB
testcase_18 AC 355 ms
97,576 KB
testcase_19 AC 356 ms
97,264 KB
testcase_20 AC 355 ms
98,564 KB
testcase_21 AC 357 ms
97,344 KB
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

bufio_scanner = []


def fmt_scan() -> str:
    sc = bufio_scanner
    if len(sc) == 0:
        for v in reversed(input().split()):
            sc.append(v)
    return sc.pop()


def main():
    n, m = [int(fmt_scan()) for _ in range(2)]
    a = [[] for _ in range(n)]
    ad = [0 for _ in range(n)]

    i = 0
    r = 1
    k = 1
    pre = ""
    for j in range(m):
        s = fmt_scan()
        if pre in ["drawtwo", "drawfour"]:
            if s != pre:
                ad[i % n] += 2 * k if "two" in pre else 4 * k
                i += r
                k = 1
            else:
                k += 1
        a[i % n].append(s)
        if s == "skip":
            i += r
        elif s == "reverse":
            r *= -1

        if j != m - 1:
            i += r
            pre = s

    i %= n
    print(i + 1, len(a[i]) - ad[i])


main()
0