結果

問題 No.769 UNOシミュレータ
ユーザー rlangevinrlangevin
提出日時 2023-01-25 00:50:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 919 bytes
コンパイル時間 696 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 78,636 KB
最終ジャッジ日時 2023-09-08 15:58:19
合計ジャッジ時間 6,208 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,268 KB
testcase_01 AC 72 ms
71,108 KB
testcase_02 AC 73 ms
71,136 KB
testcase_03 WA -
testcase_04 AC 84 ms
74,920 KB
testcase_05 AC 85 ms
74,876 KB
testcase_06 AC 84 ms
75,016 KB
testcase_07 WA -
testcase_08 AC 86 ms
74,976 KB
testcase_09 WA -
testcase_10 AC 123 ms
77,588 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 201 ms
77,832 KB
testcase_16 AC 195 ms
77,932 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 235 ms
78,264 KB
testcase_20 AC 230 ms
78,568 KB
testcase_21 AC 233 ms
78,588 KB
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
now = 0
dr = 1
L = [0] * N
cnt2, cnt4 = 0, 0
for i in range(M):
    c = input()
    if cnt2:
        if c == "drawtwo":
            L[now] += 1
            cnt2 += 2
            now += dr
            now %= N
            continue
        else:
            L[now] -= cnt2
            cnt2 = 0

        now += dr
        now %= N
    if cnt4:
        if c == "drawfour":
            L[now] += 1
            cnt4 += 4
            now += dr
            now %= N
            continue
        else:
            L[now] -= cnt4
            cnt4 = 0
        now += dr
        now %= N
        
    L[now] += 1
    if c == "number":
        pass
    elif c == "drawtwo":
        cnt2 += 2
    elif c == "drawfour":
        cnt4 += 4
    elif c == "skip":
        now += dr
        now %= N
    else:
        dr *= -1
    now += dr
    now %= N
    
if now == 0:
    now = N
print(now, L[now - 1])
0