結果

問題 No.161 制限ジャンケン
ユーザー s_shoheis_shohei
提出日時 2020-09-05 11:08:09
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 364 bytes
コンパイル時間 374 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 71,424 KB
最終ジャッジ日時 2023-08-18 16:29:06
合計ジャッジ時間 3,485 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 70 ms
71,284 KB
testcase_02 AC 72 ms
71,124 KB
testcase_03 AC 75 ms
71,200 KB
testcase_04 WA -
testcase_05 AC 71 ms
71,188 KB
testcase_06 AC 71 ms
71,172 KB
testcase_07 AC 70 ms
71,136 KB
testcase_08 AC 69 ms
71,168 KB
testcase_09 AC 68 ms
71,152 KB
testcase_10 AC 71 ms
71,304 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 70 ms
71,136 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

g,c,p = list(map(int, input().split()))
hands=[c,g,p]
s = input()
ans=0
te="CGPCGP"

for i in range(len(s)):
    draw = te.find(s[i])
    win = (te.find(s[i])+1)%3
    lose = (te.find(s[i])+2)%3

    if hands[win] > 0:
        hands[win]-=1
        ans+=3
    elif hands[draw] > 0:
        hands[draw]-=1
        ans+=1
    else:
        hands[lose]-=1

print(ans)
0