結果

問題 No.161 制限ジャンケン
ユーザー JunOnumaJunOnuma
提出日時 2017-06-22 11:26:11
言語 Python2
(2.7.18)
結果
AC  
実行時間 13 ms / 5,000 ms
コード長 370 bytes
コンパイル時間 39 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-07 12:25:29
合計ジャッジ時間 897 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,816 KB
testcase_01 AC 12 ms
6,944 KB
testcase_02 AC 12 ms
6,940 KB
testcase_03 AC 12 ms
6,940 KB
testcase_04 AC 13 ms
6,944 KB
testcase_05 AC 13 ms
6,944 KB
testcase_06 AC 13 ms
6,940 KB
testcase_07 AC 13 ms
6,940 KB
testcase_08 AC 11 ms
6,940 KB
testcase_09 AC 11 ms
6,944 KB
testcase_10 AC 10 ms
6,940 KB
testcase_11 AC 11 ms
6,940 KB
testcase_12 AC 11 ms
6,940 KB
testcase_13 AC 11 ms
6,944 KB
testcase_14 AC 10 ms
6,940 KB
testcase_15 AC 11 ms
6,944 KB
testcase_16 AC 12 ms
6,944 KB
testcase_17 AC 11 ms
6,944 KB
testcase_18 AC 12 ms
6,940 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