結果
問題 | No.161 制限ジャンケン |
ユーザー |
![]() |
提出日時 | 2020-04-21 22:44:28 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 31 ms / 5,000 ms |
コード長 | 406 bytes |
コンパイル時間 | 240 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-10-09 13:42:25 |
合計ジャッジ時間 | 1,573 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
import sysinput=lambda: sys.stdin.readline().rstrip()g,c,p=map(int,input().split())S=input()ans=0gs,cs,ps=0,0,0for s in S:if s=="G":gs+=1elif s=="C":cs+=1else:ps+=1if gs>0 and p>0:w=min(gs,p)gs-=wp-=wans+=3*wif cs>0 and g>0:w=min(cs,g)cs-=wg-=wans+=3*wif ps>0 and c>0:w=min(ps,c)ps-=wc-=wans+=3*wprint(ans+min(gs,g)+min(cs,c)+min(ps,p))