結果
| 問題 | 
                            No.161 制限ジャンケン
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2018-09-01 02:49:06 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 661 bytes | 
| コンパイル時間 | 237 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-09-14 04:45:14 | 
| 合計ジャッジ時間 | 1,621 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | RE * 3 | 
| other | RE * 16 | 
ソースコード
draw=list(map(int,input().split()))
S=input()
b={}
for i,s in enumerate(["G","C","P"]):
    b[s]=draw[i]
point=0
for j in range(len(S)):
    if(S[j]=="G"):
        for i,s in enumerate(["P","G","C"]):
            if(b[s]!=0):
                point+=bat(s,S[j])
                b[s]-=1
                break
    if(S[j]=="C"):
        for i,s in enumerate(["G","C","P"]):
            if(b[s]!=0):
                point+=bat(s,S[j])
                b[s]-=1
                break
    if(S[j]=="P"):
        for i,s in enumerate(["C","P","G"]):
            if(b[s]!=0):
                point+=bat(s,S[j])
                b[s]-=1
                break
print(point)