結果

問題 No.182 新規性の虜
ユーザー k_kadorak_kadora
提出日時 2015-06-11 00:14:57
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 426 bytes
コンパイル時間 3,169 ms
コンパイル使用メモリ 72,432 KB
実行使用メモリ 62,264 KB
最終ジャッジ日時 2023-09-20 20:42:16
合計ジャッジ時間 13,557 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,748 KB
testcase_01 AC 123 ms
56,160 KB
testcase_02 AC 123 ms
56,360 KB
testcase_03 AC 124 ms
55,832 KB
testcase_04 AC 124 ms
55,816 KB
testcase_05 AC 126 ms
55,952 KB
testcase_06 AC 123 ms
56,040 KB
testcase_07 AC 125 ms
55,828 KB
testcase_08 AC 481 ms
60,812 KB
testcase_09 AC 601 ms
60,732 KB
testcase_10 AC 542 ms
60,924 KB
testcase_11 AC 531 ms
61,132 KB
testcase_12 AC 380 ms
61,232 KB
testcase_13 AC 122 ms
55,732 KB
testcase_14 AC 127 ms
55,888 KB
testcase_15 RE -
testcase_16 AC 125 ms
56,072 KB
testcase_17 AC 128 ms
55,872 KB
testcase_18 AC 514 ms
60,676 KB
testcase_19 AC 423 ms
62,264 KB
testcase_20 AC 383 ms
60,616 KB
testcase_21 AC 497 ms
60,696 KB
testcase_22 AC 387 ms
60,468 KB
testcase_23 RE -
testcase_24 AC 505 ms
60,580 KB
testcase_25 AC 464 ms
60,576 KB
testcase_26 AC 281 ms
60,416 KB
testcase_27 AC 121 ms
56,096 KB
evil01.txt AC 553 ms
61,096 KB
evil02.txt AC 546 ms
61,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class New {
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		int n,count=0;
		n = sc.nextInt();
		int[] a = new int[n];
		for(int i = 0; i< n;i++){
			a[i] = sc.nextInt();
		}
		Arrays.sort(a);
		if(a[0] != a[1])count++;
		for(int i = 0;i<n-2;i++){
			if(a[i] != a[i+1] && a[i+1] != a[i+2])count++;
		}
		if(a[n-2] != a[n-1])count++;
		System.out.println(count);
	}
}
0