結果

問題 No.161 制限ジャンケン
ユーザー yumechi
提出日時 2015-08-26 20:27:24
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 514 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-18 14:44:23
合計ジャッジ時間 1,660 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

gi, ci, pi = map(int, input().split())
s = list(input())
s.sort()
res = 0
for c in s:
    if c == "C":
        if gi > 0:
            gi -= 1
            res += 3
        elif ci > 0:
            ci -= 1
            res += 1
    if c == "G":
        if pi > 0:
            pi -= 1
            res += 3
        elif gi > 0:
            gi -= 1
            res += 1
    if c == "P":
        if ci > 0:
            ci -= 1
            res += 3
        elif pi > 0:
            pi -= 1
            res += 1
print(res)
0