結果

問題 No.2110 012 Matching
コンテスト
ユーザー urara
提出日時 2023-01-19 03:15:23
言語 Ruby
(4.0.1)
コンパイル:
ruby -w -c _filename_
実行:
ruby _filename_
結果
AC  
実行時間 438 ms / 2,000 ms
コード長 318 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,335 ms
コンパイル使用メモリ 9,088 KB
実行使用メモリ 16,128 KB
最終ジャッジ日時 2026-03-05 06:42:31
合計ジャッジ時間 4,283 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #
raw source code

t = gets.to_i

results = []

t.times{
	a,b,c = gets.split.map &:to_i
	
	result = 0
	
	if c > a then
		result += a * 2
		c -= a
		result += c / 2
		result += b / 2 * 2
	else
		result += c * 2
		a = a - c
		result += b / 2 * 2
		
		if b % 2 == 1 && a>0 then
			result += 1
		end
	end
	
	results << result
}

puts results
0