結果

問題 No.161 制限ジャンケン
ユーザー s_shoheis_shohei
提出日時 2020-09-05 11:18:03
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 69 ms / 5,000 ms
コード長 346 bytes
コンパイル時間 318 ms
コンパイル使用メモリ 87,236 KB
実行使用メモリ 71,424 KB
最終ジャッジ日時 2023-08-18 17:09:34
合計ジャッジ時間 2,816 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
71,424 KB
testcase_01 AC 65 ms
71,260 KB
testcase_02 AC 63 ms
71,396 KB
testcase_03 AC 66 ms
71,392 KB
testcase_04 AC 69 ms
71,236 KB
testcase_05 AC 65 ms
71,300 KB
testcase_06 AC 64 ms
71,392 KB
testcase_07 AC 64 ms
71,172 KB
testcase_08 AC 64 ms
71,332 KB
testcase_09 AC 66 ms
71,124 KB
testcase_10 AC 61 ms
71,200 KB
testcase_11 AC 61 ms
71,300 KB
testcase_12 AC 62 ms
71,292 KB
testcase_13 AC 61 ms
71,240 KB
testcase_14 AC 62 ms
71,336 KB
testcase_15 AC 62 ms
71,372 KB
testcase_16 AC 62 ms
71,396 KB
testcase_17 AC 64 ms
71,288 KB
testcase_18 AC 63 ms
71,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

g,c,p = list(map(int, input().split()))
s = input()

aite_g = s.count("G")
aite_c = s.count("C")
aite_p = s.count("P")

ans=0

win = min(g,aite_c)
g-=win
aite_c-=win
ans+=win*3
win = min(c,aite_p)
c-=win
aite_p-=win
ans+=win*3
win = min(p,aite_g)
p-=win
aite_g-=win
ans+=win*3

ans+=min(g,aite_g)
ans+=min(c,aite_c)
ans+=min(p,aite_p)

print(ans)
0