結果

問題 No.769 UNOシミュレータ
ユーザー YamadaYamada
提出日時 2018-12-27 15:07:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 659 bytes
コンパイル時間 126 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,648 KB
最終ジャッジ日時 2024-05-02 00:18:53
合計ジャッジ時間 7,337 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 25 ms
10,752 KB
testcase_03 WA -
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 28 ms
10,752 KB
testcase_06 AC 29 ms
10,752 KB
testcase_07 WA -
testcase_08 AC 28 ms
10,624 KB
testcase_09 WA -
testcase_10 AC 52 ms
10,880 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 564 ms
11,136 KB
testcase_16 AC 553 ms
11,136 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 848 ms
11,648 KB
testcase_20 AC 839 ms
11,520 KB
testcase_21 AC 846 ms
11,648 KB
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M =map(int,input().split())
turn = 0
card =[0 for i in range(N)]
pls ={"drawtwo":0, "drawfour":0}
rot =+1
for i in range(M):
    ca = input()
    #ドローの処理
    for str in ["drawtwo","drawfour"]:
        if (pls[str]!=0 and str!=ca):
            card[turn%N] -= pls[str]
            pls[str] =0
            turn +=rot*1
    #出したカードの加算
    card[turn % N] += 1
    #カードの効果の処理
    if ca =="skip":
        turn +=rot*1
    elif ca =="drawtwo":
        pls[ca] +=2
    elif ca =="drawfour":
        pls[ca] +=4
    elif ca =="reverse":
        rot *=-1
    turn +=rot*1
win =turn%N
print("%d %d" % (win,card[win-1]))
0