結果
問題 | No.161 制限ジャンケン |
ユーザー |
👑 ![]() |
提出日時 | 2020-10-25 04:01:38 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 38 ms / 5,000 ms |
コード長 | 372 bytes |
コンパイル時間 | 2,418 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 53,744 KB |
最終ジャッジ日時 | 2024-07-21 16:54:57 |
合計ジャッジ時間 | 1,993 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
G,C,P=map(int,input().split())S=input()X=Y=Z=0for s in S:if s=="G":X+=1elif s=="C":Y+=1else:Z+=1Score=0alpha=min(G,Y)beta =min(C,Z)gamma=min(P,X)Score=3*(alpha+beta+gamma)G-=alpha;Y-=alphaC-=beta ;Z-=betaP-=gamma;X-=gammaalpha=min(G,X)beta =min(C,Y)gamma=min(P,Z)Score+=alpha+beta+gammaprint(Score)assert 1