結果

問題 No.182 新規性の虜
ユーザー k_kadora
提出日時 2015-06-11 00:14:57
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 426 bytes
コンパイル時間 3,438 ms
コンパイル使用メモリ 74,932 KB
実行使用メモリ 54,548 KB
最終ジャッジ日時 2024-07-06 15:30:10
合計ジャッジ時間 12,279 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25 RE * 2
権限があれば一括ダウンロードができます

ソースコード

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