結果

問題 No.507 ゲーム大会(チーム決め)
ユーザー yuruhiyayuruhiya
提出日時 2020-08-08 11:16:50
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 254 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 20,268 KB
最終ジャッジ日時 2024-04-08 17:02:06
合計ジャッジ時間 5,941 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
16,256 KB
testcase_01 AC 89 ms
16,256 KB
testcase_02 AC 88 ms
16,256 KB
testcase_03 AC 87 ms
16,256 KB
testcase_04 WA -
testcase_05 AC 86 ms
16,256 KB
testcase_06 AC 86 ms
16,256 KB
testcase_07 AC 402 ms
20,268 KB
testcase_08 AC 403 ms
20,268 KB
testcase_09 AC 383 ms
20,268 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 90 ms
16,256 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n, m = gets.split.map &:to_i
x = gets.to_i
a = Array.new(n - 1) { gets.to_i }.sort.reverse
pos =
	a.bsearch_index do |i|
		b = a.dup
		b.delete_at(a.index i)
		m <= b.each_slice(2).count { |j| x + i < j.sum }
	end || n - 1
puts pos > 0 ? a[pos - 1] : -1
0