結果

問題 No.161 制限ジャンケン
ユーザー JunOnumaJunOnuma
提出日時 2017-06-22 11:24:26
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 48 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-10 08:56:00
合計ジャッジ時間 1,494 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 14 ms
6,940 KB
testcase_02 WA -
testcase_03 AC 12 ms
6,940 KB
testcase_04 WA -
testcase_05 AC 13 ms
6,940 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

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 = max(g, ct['G'])
w += max(c, ct['C'])
w += max(p, ct['P'])
print (x+y+z)*3 + w
0