結果

問題 No.161 制限ジャンケン
ユーザー roiti46roiti46
提出日時 2015-03-05 23:35:44
言語 Python2
(2.7.18)
結果
AC  
実行時間 11 ms / 5,000 ms
コード長 287 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 6,696 KB
実行使用メモリ 6,132 KB
最終ジャッジ日時 2023-08-20 04:21:23
合計ジャッジ時間 1,104 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
6,132 KB
testcase_01 AC 10 ms
6,024 KB
testcase_02 AC 11 ms
5,852 KB
testcase_03 AC 11 ms
5,840 KB
testcase_04 AC 11 ms
5,924 KB
testcase_05 AC 10 ms
5,948 KB
testcase_06 AC 11 ms
5,984 KB
testcase_07 AC 11 ms
5,892 KB
testcase_08 AC 11 ms
6,040 KB
testcase_09 AC 11 ms
6,096 KB
testcase_10 AC 10 ms
6,084 KB
testcase_11 AC 10 ms
5,988 KB
testcase_12 AC 10 ms
5,964 KB
testcase_13 AC 11 ms
6,004 KB
testcase_14 AC 10 ms
5,840 KB
testcase_15 AC 11 ms
5,852 KB
testcase_16 AC 10 ms
5,984 KB
testcase_17 AC 10 ms
6,040 KB
testcase_18 AC 10 ms
6,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
G,C,P = map(int,raw_input().split())
s = raw_input()
g,c,p = s.count("G"),s.count("C"),s.count("P")

ans = 0
ans += 3*(min(g,P)+min(c,G)+min(p,C))
G,C,P,g,c,p = max(0,G-c),max(0,C-p),max(0,P-g),max(0,g-P),max(0,c-G),max(0,p-C)
ans += min(g,G)+min(c,C)+min(p,P)
print ans
0