結果

問題 No.769 UNOシミュレータ
ユーザー rlangevinrlangevin
提出日時 2023-01-25 01:32:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 918 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 86,852 KB
実行使用メモリ 78,452 KB
最終ジャッジ日時 2023-09-08 16:26:20
合計ジャッジ時間 4,719 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 72 ms
70,884 KB
testcase_03 WA -
testcase_04 AC 85 ms
75,092 KB
testcase_05 AC 86 ms
75,284 KB
testcase_06 AC 87 ms
75,348 KB
testcase_07 WA -
testcase_08 AC 85 ms
75,100 KB
testcase_09 WA -
testcase_10 AC 124 ms
77,572 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 197 ms
77,796 KB
testcase_16 AC 196 ms
77,912 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 236 ms
78,412 KB
testcase_20 AC 230 ms
78,452 KB
testcase_21 AC 231 ms
78,152 KB
testcase_22 AC 73 ms
71,152 KB
権限があれば一括ダウンロードができます

ソースコード

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 = 1
print(now, L[now - 1])
0