結果

問題 No.182 新規性の虜
ユーザー h_tyokinuhatah_tyokinuhata
提出日時 2016-04-10 17:46:35
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 553 bytes
コンパイル時間 2,458 ms
コンパイル使用メモリ 74,788 KB
実行使用メモリ 62,944 KB
最終ジャッジ日時 2024-04-14 23:50:38
合計ジャッジ時間 12,372 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
53,024 KB
testcase_01 AC 133 ms
54,328 KB
testcase_02 AC 130 ms
53,972 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 480 ms
59,128 KB
testcase_19 AC 427 ms
59,420 KB
testcase_20 AC 342 ms
59,260 KB
testcase_21 AC 519 ms
59,424 KB
testcase_22 AC 403 ms
59,060 KB
testcase_23 AC 121 ms
54,012 KB
testcase_24 AC 469 ms
59,140 KB
testcase_25 AC 533 ms
59,140 KB
testcase_26 RE -
testcase_27 AC 121 ms
54,060 KB
evil01.txt RE -
evil02.txt RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt(), min = Integer.MAX_VALUE, max = Integer.MIN_VALUE, cnt = 0;
		int[] a = new int[N];
		
		for(int i = 0; i < N; i++) {
			a[i] = sc.nextInt();
			
			min = Math.min(min, a[i]);
			max = Math.max(max, a[i]);
		}
		
		int[] A = new int[max - min + 1];
	
		for(int i = 0; i < N; i++) {
			A[a[i] - 1]++;
		}
		
		for(int i = 0; i < A.length; i++) {
			if(A[i] == 1)	cnt++;
		}
		
		System.out.println(cnt);
	}
}
0