結果

問題 No.182 新規性の虜
ユーザー prog470
提出日時 2016-09-15 11:33:55
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 115 ms / 5,000 ms
コード長 583 bytes
コンパイル時間 1,102 ms
コンパイル使用メモリ 80,724 KB
実行使用メモリ 12,672 KB
最終ジャッジ日時 2024-12-27 08:37:20
合計ジャッジ時間 3,381 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <string>
#include <stdio.h>

using namespace std;

int main() {

	map<int, int> m;
	set<int> s;
	int N, A;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> A;
		if (s.find(A) == s.end()) {
			s.insert(A);
			m[A] = 1;
		}else{
			m[A]++;
		}
	}

	int cnt = 0;
	set<int>::iterator it = s.begin();
	while (it != s.end()) {
		if (m[(*it)] == 1) cnt++;
		it++;
	}

	cout << cnt << endl;

	return 0;
}
0