結果

問題 No.182 新規性の虜
ユーザー taketake
提出日時 2016-07-10 16:55:35
言語 Java21
(openjdk 21)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,036 bytes
コンパイル時間 2,936 ms
コンパイル使用メモリ 73,876 KB
実行使用メモリ 63,188 KB
最終ジャッジ日時 2024-04-21 11:53:45
合計ジャッジ時間 13,292 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
41,496 KB
testcase_01 AC 104 ms
40,116 KB
testcase_02 AC 120 ms
41,184 KB
testcase_03 AC 103 ms
40,588 KB
testcase_04 AC 106 ms
40,024 KB
testcase_05 AC 103 ms
40,320 KB
testcase_06 AC 113 ms
40,344 KB
testcase_07 AC 113 ms
40,764 KB
testcase_08 AC 2,654 ms
58,004 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
evil01.txt -- -
evil02.txt -- -
権限があれば一括ダウンロードができます

ソースコード

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