結果

問題 No.182 新規性の虜
コンテスト
ユーザー take
提出日時 2016-07-10 16:55:35
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 4,077 ms / 5,000 ms
コード長 1,036 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,738 ms
コンパイル使用メモリ 82,056 KB
実行使用メモリ 59,396 KB
最終ジャッジ日時 2026-04-30 19:37:35
合計ジャッジ時間 30,694 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	
	public static void main (String[] args) throws java.lang.Exception
	{
	    Scanner sc = new Scanner(System.in);

	    // N(配列数)
	    int n = sc.nextInt();
	    //System.out.println("n=" + n);

	    // 配列
	    int hs[];
	    hs= new int[n]; 

        int index = 0;
	    while((sc.hasNext()) && (index < n + 1)){
	        int s = sc.nextInt();
	        hs[index] = s;
	        //System.out.println("hs[index]=" + hs[index]);
		    index++;
	    }

		// 新規カウント
		int c = 0;
	    for (int i = 0; i < n; i++){
		  	if (isSinki(hs, n, i) ) {
		  		c++;
		  	}
		}
		
		System.out.println(c);
	}
	
	
	public static boolean isSinki (int[] hs, int n, int index){
		
		for (int i = 0; i < n; i++){
			
			if (i != index) {
				if (hs[i] == hs[index]) {
					return false;
				}
			}
		  	
		}
		
		return true;		
	}
	
		
}
0