結果
| 問題 |
No.161 制限ジャンケン
|
| コンテスト | |
| ユーザー |
lllllll88938494
|
| 提出日時 | 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=0
for i in range(len(s)):
if s[i] =='G' and p > 0:
p -= 1
cnt+=3
elif s[i] =='C' and g > 0:
g -= 1
cnt+=3
elif s[i] =='P' and c > 0:
c -= 1
cnt+=3
else:
f[i] += 1
for i in range(len(s)):
if f[i] == 0:
continue
if s[i] =='G' and g > 0:
g -= 1
cnt+=1
elif s[i] =='C' and c > 0:
c -= 1
cnt+=1
elif s[i] =='P' and p > 0:
p -= 1
cnt+=1
print(cnt)
lllllll88938494