結果

問題 No.2110 012 Matching
ユーザー 👑 tatt61880tatt61880
提出日時 2023-03-13 23:14:35
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 309 ms / 2,000 ms
コード長 602 bytes
コンパイル時間 2,017 ms
コンパイル使用メモリ 145,352 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-18 11:24:30
合計ジャッジ時間 6,861 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 79 ms
4,348 KB
testcase_02 AC 204 ms
4,348 KB
testcase_03 AC 136 ms
4,348 KB
testcase_04 AC 270 ms
4,348 KB
testcase_05 AC 191 ms
4,348 KB
testcase_06 AC 185 ms
4,348 KB
testcase_07 AC 307 ms
4,348 KB
testcase_08 AC 12 ms
4,348 KB
testcase_09 AC 46 ms
4,348 KB
testcase_10 AC 309 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var t: int :: cui@inputInt()
	for(1, t)
		var a: int :: cui@inputInt()
		var b: int :: cui@inputInt()
		var c: int :: cui@inputInt()
		var f: bool :: (a + b + c) % 2 = 0
		
		var ans: int :: 0
		
		if(a <= c)
			do ans :+ 2 * a
			do c :- a
			do a :: 0
			
			do ans :+ c / 2
			
			if(b % 2 = 0)
				do ans :+ b
			else
				do ans :+ b - 1
			end if
		else
			do ans :+ 2 * c
			do a :- c
			do c :: 0
			
			if(b % 2 = 0)
				do ans :+ b
			else
				if(a <> 0)
					do ans :+ b
				else
					do ans :+ b - 1
				end if
			end if
		end if
		
		do cui@print("\{ans}\n")
	end for
end func
0