結果

問題 No.1380 Borderline
ユーザー tenten
提出日時 2021-02-08 17:33:16
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 477 bytes
コンパイル時間 2,069 ms
コンパイル使用メモリ 74,624 KB
実行使用メモリ 41,668 KB
最終ジャッジ日時 2024-07-05 19:24:29
合計ジャッジ時間 9,362 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 40 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] arr = new int[n + 2];
        for (int i = 0; i < n; i++) {
            arr[i] = -sc.nextInt();
        }
        arr[n] = Integer.MIN_VALUE;
        Arrays.sort(arr);
        while (arr[k] == arr[k + 1]) {
            k--;
        }
        System.out.println(k);
    }
}
0