結果

問題 No.161 制限ジャンケン
ユーザー kmjp
提出日時 2015-09-19 10:50:05
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 556 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2024-07-19 07:53:42
合計ジャッジ時間 1,159 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

G,C,P = map(int,raw_input().strip().split())
S = raw_input().strip()

point = 0
for i in range(len(S)):
    if S[i]=="G":
        if P>0:
            P-=1;point+=3
        elif G>0:
            G-=1;point+=1
        else:
            C-=1
    
    if S[i]=="C":
        if G>0:
            G-=1;point+=3
        elif C>0:
            C-=1;point+=1
        else:
            P-=1
    
    if S[i]=="P":
        if C>0:
            C-=1;point+=3
        elif P>0:
            P-=1;point+=1
        else:
            G-=1

print point
0