結果

問題 No.2110 012 Matching
ユーザー uraraurara
提出日時 2023-01-19 03:15:23
言語 Ruby
(3.2.2)
結果
AC  
実行時間 353 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 340 ms
コンパイル使用メモリ 11,524 KB
実行使用メモリ 17,212 KB
最終ジャッジ日時 2023-09-02 20:40:01
合計ジャッジ時間 4,353 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,032 KB
testcase_01 AC 152 ms
16,208 KB
testcase_02 AC 258 ms
16,884 KB
testcase_03 AC 202 ms
16,532 KB
testcase_04 AC 321 ms
17,060 KB
testcase_05 AC 252 ms
17,120 KB
testcase_06 AC 243 ms
16,916 KB
testcase_07 AC 352 ms
17,200 KB
testcase_08 AC 91 ms
15,900 KB
testcase_09 AC 122 ms
16,296 KB
testcase_10 AC 353 ms
17,212 KB
testcase_11 AC 80 ms
15,036 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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