結果

問題 No.182 新規性の虜
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-13 05:17:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 585 ms / 5,000 ms
コード長 542 bytes
コンパイル時間 4,420 ms
コンパイル使用メモリ 70,852 KB
実行使用メモリ 60,944 KB
最終ジャッジ日時 2023-08-27 13:49:14
合計ジャッジ時間 13,178 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,956 KB
testcase_01 AC 117 ms
55,480 KB
testcase_02 AC 119 ms
55,660 KB
testcase_03 AC 120 ms
55,784 KB
testcase_04 AC 120 ms
55,560 KB
testcase_05 AC 118 ms
55,700 KB
testcase_06 AC 119 ms
55,448 KB
testcase_07 AC 118 ms
55,700 KB
testcase_08 AC 459 ms
60,636 KB
testcase_09 AC 585 ms
60,944 KB
testcase_10 AC 532 ms
60,812 KB
testcase_11 AC 520 ms
60,776 KB
testcase_12 AC 365 ms
60,532 KB
testcase_13 AC 117 ms
55,352 KB
testcase_14 AC 121 ms
56,036 KB
testcase_15 AC 116 ms
55,596 KB
testcase_16 AC 117 ms
55,668 KB
testcase_17 AC 122 ms
55,464 KB
testcase_18 AC 448 ms
60,720 KB
testcase_19 AC 412 ms
59,952 KB
testcase_20 AC 344 ms
60,824 KB
testcase_21 AC 484 ms
60,680 KB
testcase_22 AC 363 ms
60,292 KB
testcase_23 AC 117 ms
57,548 KB
testcase_24 AC 476 ms
60,172 KB
testcase_25 AC 439 ms
60,344 KB
testcase_26 AC 271 ms
60,208 KB
testcase_27 AC 117 ms
55,912 KB
evil01.txt AC 528 ms
60,352 KB
evil02.txt AC 547 ms
60,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int [] A = new int [N+2];
        A[0] = 0;
        A[N+1] = Integer.MAX_VALUE;
        for(int i=1; i<=N; i++){
            A[i] = sc.nextInt();
        }
        Arrays.sort(A);
        int count = 0;
        for(int i=1; i<=N; i++){
            if(A[i]!=A[i-1] && A[i]!=A[i+1]){
                count++;
            }
        }
        System.out.println(count);
    }
}
0