結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,276 KB
testcase_01 AC 71 ms
71,336 KB
testcase_02 AC 73 ms
71,116 KB
testcase_03 AC 71 ms
71,156 KB
testcase_04 AC 87 ms
75,568 KB
testcase_05 AC 84 ms
75,224 KB
testcase_06 AC 85 ms
75,540 KB
testcase_07 AC 90 ms
75,764 KB
testcase_08 AC 85 ms
75,484 KB
testcase_09 WA -
testcase_10 AC 127 ms
77,912 KB
testcase_11 AC 125 ms
78,132 KB
testcase_12 WA -
testcase_13 AC 198 ms
82,308 KB
testcase_14 AC 202 ms
81,976 KB
testcase_15 WA -
testcase_16 AC 275 ms
90,080 KB
testcase_17 AC 262 ms
91,388 KB
testcase_18 AC 335 ms
97,756 KB
testcase_19 AC 351 ms
97,396 KB
testcase_20 WA -
testcase_21 AC 335 ms
97,356 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
    pre = ""
    for j in range(m):
        s = fmt_scan()
        if pre in ["drawtwo", "drawfour"] and s != pre:
            ad[i] += 2 if "two" in pre else 4
            i = (i + r) % n
        a[i].append(s)
        if s == "skip":
            i += r
        elif s == "reverse":
            r *= -1

        if j != m - 1:
            i = (i + r) % n
            pre = s

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


main()
0