結果

問題 No.91 赤、緑、青の石
ユーザー 👑 tatt61880tatt61880
提出日時 2019-04-03 01:25:38
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 709 bytes
コンパイル時間 3,379 ms
コンパイル使用メモリ 159,796 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-06 12:41:58
合計ジャッジ時間 4,762 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 3 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 3 ms
4,376 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var _: [][]char :: cui@input().split(" ")
	var R: int :: _[0].toInt(&)
	var G: int :: _[1].toInt(&)
	var B: int :: _[2].toInt(&)
	var ans: int :: [R, G, B].min()
	do R :- ans
	do G :- ans
	do B :- ans
	var sum: int :: R + G + B
	var n1: int :: [R, G, B].max()
	var n2: int :: sum - n1
	var ok: int :: 0
	var ng: int :: n1
	while(ng - ok > 1)
		var md: int :: (ok + ng) / 2
		var f: bool
		if(md >= n2)
			var mdd: int :: md
			do mdd :- n2
			do f :: (n1 - 3 * n2 >= 5 * mdd)
		else
			var n22: int :: n2 - md
			var n11: int :: n1 - md
			do f :: (n11 / 2 + n22 / 2 >= md)
		end if
		if(f)
			do ok :: md
		else
			do ng :: md
		end if
	end while
	do ans :+ ok
	do cui@print("\{ans}\n")
end func
0