結果
| 問題 |
No.161 制限ジャンケン
|
| コンテスト | |
| ユーザー |
nohakai3
|
| 提出日時 | 2022-11-07 21:10:13 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 309 bytes |
| コンパイル時間 | 171 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 65,024 KB |
| 最終ジャッジ日時 | 2024-07-21 04:13:49 |
| 合計ジャッジ時間 | 2,088 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 16 |
ソースコード
g,c,p=map(int,input().split())
s=list(input())
g2,c2,p2=0,0,0
for x in s:
if x=="G":
g2+=1
elif x=="C":
c2+=1
else:
p2+=1
ans=3*min(g,c2)+3*min(c,p2)+3*min(p,g2)
ans+=min(max(0,g2-p),max(g-c2))
ans+=min(max(0,c2-g),max(0,c-p2))
ans+=min(max(0,p2-c),max(0,p-g2))
print(ans)
nohakai3