結果

問題 No.909 たぴの配置
ユーザー 👑 tatt61880tatt61880
提出日時 2021-02-25 17:21:11
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 355 ms / 3,000 ms
コード長 671 bytes
コンパイル時間 2,256 ms
コンパイル使用メモリ 150,792 KB
実行使用メモリ 6,704 KB
最終ジャッジ日時 2023-10-14 17:26:07
合計ジャッジ時間 10,224 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,356 KB
testcase_01 AC 2 ms
4,352 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,352 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 304 ms
6,600 KB
testcase_06 AC 333 ms
6,704 KB
testcase_07 AC 304 ms
6,332 KB
testcase_08 AC 330 ms
6,600 KB
testcase_09 AC 355 ms
6,492 KB
testcase_10 AC 309 ms
6,236 KB
testcase_11 AC 313 ms
6,332 KB
testcase_12 AC 293 ms
6,492 KB
testcase_13 AC 313 ms
6,540 KB
testcase_14 AC 312 ms
6,380 KB
testcase_15 AC 293 ms
6,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var n: int :: cui@inputInt()
	var x: []int :: #[n]int
	for i(0, n - 1)
		do x[i] :: cui@inputInt()
	end for
	var y: []int :: #[n]int
	for i(0, n - 1)
		do y[i] :: cui@inputInt()
	end for
	
	var ok: int :: 0
	var ng: int :: 10 ^ 7
	while((ok - ng).abs() > 1)
		var mid: int :: (ok + ng) / 2
		var isOk: bool :: true
		
		for i(0, n - 1)
			if(mid > x[i] + y[i])
				do isOk :: false
				break i
			end if
		end for
		if(isOk)
			do ok :: mid
		else
			do ng :: mid
		end if
	end while
	var ans: int :: ok
	do cui@print("\{ans}\n")
	
	do cui@print("0\n")
	for i(0, n - 1)
		do cui@print("\{x[i] < ok ?(x[i], ok)}\n")
	end for
	do cui@print("\{ok}\n")
end func
0