結果
問題 | 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,0for s in S:if s=="G":G2+=1elif s=="C":C2+=1else:P2+=1ANS=0x=min(G2,P)ANS+=x*3G2-=xP-=xx=min(C2,G)ANS+=x*3C2-=xG-=xx=min(P2,C)ANS+=x*3P2-=xC-=xx=min(G2,G)ANS+=xG2-=xG-=xx=min(C2,C)ANS+=xC2-=xC-=xx=min(P2,P)ANS+=xP2-=xP-=xprint(ANS)