結果

問題 No.161 制限ジャンケン
ユーザー nobuta05nobuta05
提出日時 2015-03-26 15:17:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 445 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 11,012 KB
実行使用メモリ 7,988 KB
最終ジャッジ日時 2023-09-11 10:18:12
合計ジャッジ時間 1,476 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 17 ms
7,972 KB
testcase_02 AC 16 ms
7,864 KB
testcase_03 AC 16 ms
7,896 KB
testcase_04 WA -
testcase_05 AC 16 ms
7,828 KB
testcase_06 AC 16 ms
7,844 KB
testcase_07 AC 16 ms
7,856 KB
testcase_08 AC 16 ms
7,792 KB
testcase_09 AC 16 ms
7,848 KB
testcase_10 AC 16 ms
7,860 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 16 ms
7,848 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def calc(win,draw,lose,res):
    if win > 0:
        win -= 1
        res += 3
    elif draw > 0:
        draw -= 1
        res += 1
    else:
        lose -= 1
    return [win,draw,lose,res]

G,C,P = [int(x) for x in input().split(" ")]
S = input()

res = 0
for x in S:
    if x == 'G':
        
        P,G,C,res = calc(P,G,C,res)
    elif x == 'C':
        G,C,P,res = calc(G,C,P,res)
    else:
        C,P,G,res = calc(C,P,G,res)

print(res)
0