結果

問題 No.161 制限ジャンケン
ユーザー kmjp
提出日時 2015-02-02 02:19:22
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 407 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-06-23 06:22:12
合計ジャッジ時間 1,447 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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