結果

問題 No.161 制限ジャンケン
ユーザー matriematrie
提出日時 2021-02-14 09:52:57
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 5,000 ms
コード長 214 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-21 15:30:14
合計ジャッジ時間 1,504 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

G,C,P=map(int,input().split())
s=input()
g=s.count('G')
c=s.count('C')
p=s.count('P')
a=t=0
t=min(g,P);a+=t*3;g-=t;P-=t
t=min(c,G);a+=t*3;c-=t;G-=t
t=min(p,C);a+=t*3;p-=t;C-=t
a+=min(g,G)+min(c,C)+min(p,P)
print(a)
0