結果

問題 No.182 新規性の虜
ユーザー take
提出日時 2016-07-10 16:55:35
言語 Java
(openjdk 23)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,036 bytes
コンパイル時間 3,034 ms
コンパイル使用メモリ 75,640 KB
実行使用メモリ 75,896 KB
最終ジャッジ日時 2024-10-13 10:23:10
合計ジャッジ時間 13,445 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 TLE * 1 -- * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

/* 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