結果
問題 |
No.161 制限ジャンケン
|
ユーザー |
![]() |
提出日時 | 2022-04-03 00:17:31 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 33 ms / 5,000 ms |
コード長 | 366 bytes |
コンパイル時間 | 404 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-11-22 05:59:13 |
合計ジャッジ時間 | 2,019 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
G,C,P=map(int,input().split()) S=input() G2,C2,P2=0,0,0 for s in S: if s=="G": G2+=1 elif s=="C": C2+=1 else: P2+=1 ANS=0 x=min(G2,P) ANS+=x*3 G2-=x P-=x x=min(C2,G) ANS+=x*3 C2-=x G-=x x=min(P2,C) ANS+=x*3 P2-=x C-=x x=min(G2,G) ANS+=x G2-=x G-=x x=min(C2,C) ANS+=x C2-=x C-=x x=min(P2,P) ANS+=x P2-=x P-=x print(ANS)