結果

問題 No.161 制限ジャンケン
ユーザー suppy193suppy193
提出日時 2015-06-17 16:32:41
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 433 bytes
コンパイル時間 244 ms
コンパイル使用メモリ 11,500 KB
実行使用メモリ 15,368 KB
最終ジャッジ日時 2023-09-21 09:20:52
合計ジャッジ時間 3,133 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 77 ms
15,264 KB
testcase_02 WA -
testcase_03 AC 78 ms
15,248 KB
testcase_04 WA -
testcase_05 AC 76 ms
15,260 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

yuki = gets.chomp.split(' ').map {|i| i.to_i}
s = gets.chomp
aite = [s.scan('C').length, s.scan('P').length, s.scan('G').length]
#p yuki
#p s
#p aite
point = 0
(0...3).each do |i|
	if yuki[i] >= aite[i]
		point += 3 * aite[i]
		yuki[i] -= aite[i]
		aite[i] = 0
	else
		point += 3 * yuki[i]
		yuki[i] = 0
		aite[i] -= yuki[i]
	end
end
#puts point
#p aite.unshift(aite.pop)
#p aite
(0...3).each do |i|
	point += yuki[i]
end
puts point
0