結果

問題 No.182 新規性の虜
コンテスト
ユーザー take
提出日時 2016-07-10 17:50:19
言語 Java
(openjdk 26.0.2.1 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
TLE  
実行時間 -
コード長 1,087 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,659 ms
コンパイル使用メモリ 93,536 KB
実行使用メモリ 63,680 KB
最終ジャッジ日時 2026-09-15 15:02:27
合計ジャッジ時間 32,972 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 TLE * 2 -- * 5
権限があれば一括ダウンロードができます

ソースコード

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);
	    
	    
	    List<Integer> list = new ArrayList<Integer>();

        int index = 0;
	    while((sc.hasNext()) && (index < n + 1)){
	        int s = sc.nextInt();
	        list.add(s);
		    index++;
	    }
	    
	    //HashSet<Integer> hashSet = new HashSet<Integer>();
        //hashSet.addAll(list);
        
        
        
		// 重複しない配列
        Set<Integer> set = new HashSet<Integer>();
		for (Integer s : list) {
			if (!set.contains(s)) {
				set.add(s);
			}
		}
		
		// 新規カウント
		int c = 0 ;
		
		for (Integer x : set) {
			int cc = Collections.frequency(list, x);
			if (cc == 1) {
				c++;
			}
		}
		
		

		System.out.println(c);
	}
	
	
	
	
		
}
0