結果

問題 No.769 UNOシミュレータ
ユーザー ttrttr
提出日時 2020-05-27 22:21:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 640 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2024-04-21 05:20:12
合計ジャッジ時間 7,698 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,752 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 WA -
testcase_04 AC 31 ms
10,624 KB
testcase_05 AC 30 ms
10,752 KB
testcase_06 AC 31 ms
10,752 KB
testcase_07 WA -
testcase_08 AC 34 ms
10,624 KB
testcase_09 WA -
testcase_10 AC 54 ms
10,752 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 547 ms
11,008 KB
testcase_16 AC 560 ms
11,136 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 828 ms
11,520 KB
testcase_20 AC 820 ms
11,392 KB
testcase_21 AC 812 ms
11,520 KB
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int, input().split())

ans = 0
prev = 0
next = 1
card = [0]*N
cnt = 0
for _ in range(M):
    l = input()
    card[ans] += 1
    if (prev == "drawtwo" or prev == "drawfour") and prev != l:
        card[ans] -= 1+cnt
        cnt = 0
        ans += next
        card[ans%N] += 1
    if l == "number" or l == "drawtwo" or l == "drawfour":
        ans += next
        if l == "drawtwo":
            cnt += 2
        elif l == "drawfour":
            cnt += 4
    elif l == "skip":
        ans += next*2
    elif l == "reverse":
        next *= -1
        ans += next
    prev = l
    ans %= N

ans = (ans-1)%N+1
print(ans, card[ans-1])
0