結果

問題 No.161 制限ジャンケン
コンテスト
ユーザー taba
提出日時 2016-04-16 22:47:33
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 79 ms / 5,000 ms
コード長 212 bytes
記録
コンパイル時間 229 ms
コンパイル使用メモリ 77,464 KB
最終ジャッジ日時 2025-12-03 20:27:09
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

g,c,p=map(int,raw_input().split())
s=raw_input()
G,C,P=[s.count(i)for i in"GCP"]
a=0
t=min(g,C)
a+=t*3
g-=t
C-=t
t=min(c,P)
a+=t*3
c-=t
P-=t
t=min(p,G)
a+=t*3
p-=t
G-=t
a+=min(g,G)
a+=min(c,C)
a+=min(p,P)
print a
0