結果
問題 | No.161 制限ジャンケン |
ユーザー |
![]() |
提出日時 | 2022-06-02 12:15:33 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 39 ms / 5,000 ms |
コード長 | 623 bytes |
コンパイル時間 | 147 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 52,224 KB |
最終ジャッジ日時 | 2024-09-21 01:56:15 |
合計ジャッジ時間 | 1,494 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
g,c,p=map(int,input().split())s=input()f=[0]*len(s)cnt=0for i in range(len(s)):if s[i] =='G' and p > 0:p -= 1cnt+=3elif s[i] =='C' and g > 0:g -= 1cnt+=3elif s[i] =='P' and c > 0:c -= 1cnt+=3else:f[i] += 1for i in range(len(s)):if f[i] == 0:continueif s[i] =='G' and g > 0:g -= 1cnt+=1elif s[i] =='C' and c > 0:c -= 1cnt+=1elif s[i] =='P' and p > 0:p -= 1cnt+=1print(cnt)