結果

問題 No.1380 Borderline
ユーザー xRS43BofaUEZ5gcxRS43BofaUEZ5gc
提出日時 2021-03-05 09:48:15
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 593 bytes
コンパイル時間 3,835 ms
コンパイル使用メモリ 75,604 KB
実行使用メモリ 56,480 KB
最終ジャッジ日時 2024-04-15 22:40:16
合計ジャッジ時間 12,417 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 148 ms
41,580 KB
testcase_01 AC 142 ms
41,788 KB
testcase_02 AC 141 ms
41,884 KB
testcase_03 AC 141 ms
41,420 KB
testcase_04 AC 141 ms
41,468 KB
testcase_05 RE -
testcase_06 AC 142 ms
41,620 KB
testcase_07 RE -
testcase_08 AC 140 ms
42,008 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 139 ms
41,704 KB
testcase_12 AC 143 ms
41,472 KB
testcase_13 AC 141 ms
41,604 KB
testcase_14 AC 155 ms
41,912 KB
testcase_15 AC 155 ms
42,008 KB
testcase_16 AC 156 ms
42,036 KB
testcase_17 AC 152 ms
41,844 KB
testcase_18 AC 157 ms
41,728 KB
testcase_19 AC 157 ms
41,844 KB
testcase_20 AC 155 ms
41,828 KB
testcase_21 AC 153 ms
41,932 KB
testcase_22 AC 152 ms
41,684 KB
testcase_23 AC 151 ms
41,916 KB
testcase_24 AC 153 ms
41,864 KB
testcase_25 AC 155 ms
41,864 KB
testcase_26 AC 154 ms
41,912 KB
testcase_27 AC 155 ms
41,756 KB
testcase_28 AC 159 ms
41,980 KB
testcase_29 AC 154 ms
41,724 KB
testcase_30 AC 157 ms
41,776 KB
testcase_31 AC 159 ms
41,928 KB
testcase_32 AC 154 ms
41,912 KB
testcase_33 AC 159 ms
41,864 KB
testcase_34 AC 155 ms
41,792 KB
testcase_35 AC 155 ms
41,692 KB
testcase_36 AC 155 ms
41,716 KB
testcase_37 AC 153 ms
41,684 KB
testcase_38 AC 153 ms
41,576 KB
testcase_39 AC 156 ms
41,640 KB
testcase_40 AC 155 ms
41,724 KB
testcase_41 AC 154 ms
41,608 KB
testcase_42 AC 154 ms
41,732 KB
testcase_43 AC 152 ms
41,820 KB
testcase_44 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;

public class HelloWorld {

	    public static void main(String[] args) throws Exception {

	    	Scanner sc = new Scanner(System.in);
	    	int n = sc.nextInt();
	    	int k = sc.nextInt();
	    	int[] pi = new int[n];

	    	for (int i=0; i < n; i ++) {
	    		pi[i] = sc.nextInt();
	    	}
	    	sc.close();
	    	Arrays.sort(pi);

	    	for (int i = n - k; i  < n ; i ++) {
	    		if (pi[i - 1] != pi[i]) {
	    			System.out.println(n - i);
	    			break;
	    		}
	    		if (i == n - 1) {System.out.println(0);}
	    	}

	    	}

	    }
0