結果

問題 No.161 制限ジャンケン
ユーザー ktshunktshun
提出日時 2015-06-09 11:04:51
言語 Python2
(2.7.18)
結果
AC  
実行時間 14 ms / 5,000 ms
コード長 459 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 7,108 KB
実行使用メモリ 6,456 KB
最終ジャッジ日時 2023-08-20 04:32:02
合計ジャッジ時間 1,372 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
6,456 KB
testcase_01 AC 13 ms
6,352 KB
testcase_02 AC 13 ms
6,456 KB
testcase_03 AC 13 ms
6,276 KB
testcase_04 AC 13 ms
6,248 KB
testcase_05 AC 12 ms
6,268 KB
testcase_06 AC 13 ms
6,212 KB
testcase_07 AC 13 ms
6,276 KB
testcase_08 AC 13 ms
6,276 KB
testcase_09 AC 14 ms
6,184 KB
testcase_10 AC 12 ms
6,180 KB
testcase_11 AC 13 ms
6,176 KB
testcase_12 AC 13 ms
6,176 KB
testcase_13 AC 14 ms
6,316 KB
testcase_14 AC 13 ms
6,316 KB
testcase_15 AC 13 ms
6,276 KB
testcase_16 AC 13 ms
6,356 KB
testcase_17 AC 13 ms
6,244 KB
testcase_18 AC 13 ms
6,356 KB
権限があれば一括ダウンロードができます

ソースコード

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