結果

問題 No.161 制限ジャンケン
ユーザー ktshun
提出日時 2015-06-09 11:04:51
言語 Python2
(2.7.18)
結果
AC  
実行時間 13 ms / 5,000 ms
コード長 459 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,656 KB
最終ジャッジ日時 2024-11-30 04:39:01
合計ジャッジ時間 1,211 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding:utf-8 -*-
import collections 

if __name__ == "__main__":
	jibun = map(int,raw_input().split())#g,c,p
	s = raw_input()
	aite = [0,0,0]
	aite[0] = s.count("C")
	aite[1] = s.count("P")
	aite[2] = s.count("G")
	ans = 0
	for i in xrange(3): #勝ち点取得
		temp = min(jibun[i],aite[i])
		ans += temp * 3
		jibun[i] -= temp
		aite[i] -= temp
	aite = aite[2:3] + aite[0:2]
	for i in xrange(3):
		temp = min(jibun[i],aite[i])
		ans += temp
	print ans
0