結果

問題 No.182 新規性の虜
ユーザー YukimotoPGYukimotoPG
提出日時 2019-03-01 12:15:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 197 ms / 5,000 ms
コード長 2,724 bytes
コンパイル時間 2,179 ms
コンパイル使用メモリ 79,916 KB
実行使用メモリ 61,280 KB
最終ジャッジ日時 2023-09-05 16:31:18
合計ジャッジ時間 6,538 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
49,312 KB
testcase_01 AC 40 ms
49,192 KB
testcase_02 AC 40 ms
49,316 KB
testcase_03 AC 41 ms
49,152 KB
testcase_04 AC 40 ms
49,096 KB
testcase_05 AC 40 ms
49,164 KB
testcase_06 AC 41 ms
49,696 KB
testcase_07 AC 40 ms
49,360 KB
testcase_08 AC 189 ms
61,280 KB
testcase_09 AC 197 ms
57,704 KB
testcase_10 AC 186 ms
57,564 KB
testcase_11 AC 181 ms
58,184 KB
testcase_12 AC 140 ms
58,832 KB
testcase_13 AC 40 ms
49,164 KB
testcase_14 AC 41 ms
49,716 KB
testcase_15 AC 40 ms
49,628 KB
testcase_16 AC 40 ms
49,144 KB
testcase_17 AC 40 ms
49,608 KB
testcase_18 AC 139 ms
55,064 KB
testcase_19 AC 143 ms
54,884 KB
testcase_20 AC 119 ms
54,584 KB
testcase_21 AC 168 ms
58,604 KB
testcase_22 AC 128 ms
57,392 KB
testcase_23 AC 41 ms
49,196 KB
testcase_24 AC 168 ms
59,772 KB
testcase_25 AC 117 ms
52,412 KB
testcase_26 AC 103 ms
54,336 KB
testcase_27 AC 40 ms
49,272 KB
evil01.txt AC 236 ms
64,680 KB
evil02.txt AC 244 ms
64,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.util.stream.*;
import static java.lang.System.*;
import java.io.*;

class Main {
//	static Scanner sc = new Scanner(System.in);
	static int maxInt = Integer.MAX_VALUE;
	static int minInt = Integer.MIN_VALUE;
//	static int nextInt () {return Integer.parseInt(sc.next());}
//	static int[] nextIntArray (int n) {return IntStream.range(0,n).map(i->nextInt()).toArray();}
	static int max (int... ar) {Arrays.sort(ar);return ar[ar.length-1];}
	static int min (int... ar) {Arrays.sort(ar);return ar[0];}


	static FastScanner sc = new FastScanner();
	public static void main(String[] args) {
		//MAIN----------------------------------------------------------

		int n = sc.nextInt();
		HashMap<Integer, Integer> map = new HashMap<>();
		for (int i=0; i<n; i++) {
			int temp = sc.nextInt();
			map.put(temp, map.getOrDefault(temp,0)+1);
		}
		
		int ans = 0;
		for (Map.Entry<Integer, Integer> e: map.entrySet()) {
			if (e.getValue() == 1) ans++;
		}
		out.println(ans);
		
		//--------------------------------------------------------------
	}
}


class FastScanner {
	private InputStream in = System.in;
	private byte[] buffer = new byte[10];
	private int length = 0;
	private int p = 0;

	boolean hasNextByte () {
		if (p < length) return true;
		else {
			p = 0;
			try {length = in.read(buffer);}
			catch (Exception e) {e.printStackTrace();}
			if (length == 0) return false;
		}
		return true;
	}

	int readByte () {
		if (hasNextByte() == true) return buffer[p++];
		return -1;
	}

	boolean isPrintable (int n) {return 33<=n&&n<=126;}
	void skip () {
		while (hasNextByte() && !isPrintable(buffer[p])) p++;
	}
	boolean hasNext () {skip(); return hasNextByte();}

	String next () {
		if (!hasNext()) throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int temp = readByte();
		while (isPrintable(temp)) {
			sb.appendCodePoint(temp);
			temp = readByte();
		}
		return sb.toString();
	}

	public int nextInt () {
		long n = nextLong();
		if (n<Integer.MIN_VALUE || Integer.MAX_VALUE<n) {
			throw new ArithmeticException();
		}
		return (int) n;
	}

	public int[] nextInts (int n) {
		int[] ar = new int[n];
		for (int i=0; i<n; i++) ar[i] = nextInt();
		return ar;
	}

	public long nextLong () {
		if (!hasNext()) throw new NoSuchElementException();
		boolean minus = false;
		int temp = readByte();
		if (temp == '-') {
			minus = true;
			temp = readByte();
		}
		if (temp<'0' || '9'<temp) throw new NumberFormatException();
		long n = 0;
		while (isPrintable(temp)) {
			if ('0'<=temp && temp<='9') {
				n *= 10;
				n += temp - '0';
			}
			else throw new NumberFormatException();
			temp = readByte();
		}
		return minus? -n : n;
	}
}






















0