結果

問題 No.161 制限ジャンケン
ユーザー JunOnumaJunOnuma
提出日時 2017-06-22 11:26:11
言語 Python2
(2.7.18)
結果
AC  
実行時間 15 ms / 5,000 ms
コード長 370 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 6,604 KB
実行使用メモリ 6,480 KB
最終ジャッジ日時 2023-08-20 05:03:16
合計ジャッジ時間 1,317 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
6,216 KB
testcase_01 AC 12 ms
6,400 KB
testcase_02 AC 12 ms
6,208 KB
testcase_03 AC 13 ms
6,468 KB
testcase_04 AC 12 ms
6,340 KB
testcase_05 AC 13 ms
6,284 KB
testcase_06 AC 13 ms
6,208 KB
testcase_07 AC 13 ms
6,204 KB
testcase_08 AC 13 ms
6,204 KB
testcase_09 AC 14 ms
6,388 KB
testcase_10 AC 13 ms
6,336 KB
testcase_11 AC 13 ms
6,328 KB
testcase_12 AC 13 ms
6,292 KB
testcase_13 AC 12 ms
6,384 KB
testcase_14 AC 15 ms
6,388 KB
testcase_15 AC 13 ms
6,284 KB
testcase_16 AC 13 ms
6,348 KB
testcase_17 AC 13 ms
6,432 KB
testcase_18 AC 13 ms
6,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
g,c,p = map(int, raw_input().split())
ct = Counter(raw_input())
x = min(g, ct['C'])
g = max(0, g-x)
ct['C'] = max(0, ct['C']-x)
y = min(c, ct['P'])
c = max(0, c-y)
ct['P'] = max(0, ct['P']-y)
z = min(p, ct['G'])
p = max(0, p-z)
ct['G'] = max(0, ct['G']-z)
w = min(g, ct['G'])
w += min(c, ct['C'])
w += min(p, ct['P'])
print (x+y+z)*3 + w
0