結果

問題 No.507 ゲーム大会(チーム決め)
ユーザー yuruhiyayuruhiya
提出日時 2020-08-08 11:52:24
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 203 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 18,944 KB
最終ジャッジ日時 2024-04-08 21:09:14
合計ジャッジ時間 5,479 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
16,256 KB
testcase_01 AC 89 ms
16,256 KB
testcase_02 AC 81 ms
16,256 KB
testcase_03 AC 81 ms
16,256 KB
testcase_04 AC 83 ms
16,256 KB
testcase_05 AC 82 ms
16,256 KB
testcase_06 AC 82 ms
16,256 KB
testcase_07 AC 376 ms
18,944 KB
testcase_08 AC 331 ms
18,944 KB
testcase_09 AC 378 ms
18,648 KB
testcase_10 AC 352 ms
18,648 KB
testcase_11 AC 337 ms
18,944 KB
testcase_12 AC 377 ms
18,648 KB
testcase_13 AC 346 ms
18,944 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,m=gets.split.map &:to_i
x=gets.to_i
a=(1...n).map{gets.to_i}.sort.reverse
pos=a.bsearch_index{|y|
j=n-2
(0...n-1).count{|i|
j-=1while i<j&&x+y>=a[i]+a[j]
i>=j ?false:j-=1}>=m}||n-1
p pos>0?a[pos-1]:-1
0