結果

問題 No.182 新規性の虜
ユーザー satanic
提出日時 2015-12-06 15:07:22
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 56 ms / 5,000 ms
コード長 427 bytes
コンパイル時間 751 ms
コンパイル使用メモリ 61,916 KB
実行使用メモリ 8,064 KB
最終ジャッジ日時 2024-12-26 19:58:53
合計ジャッジ時間 2,419 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <set>
using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, input, total=0;
  set<int> a;
  set<int> aOverlap;
  set<int>::iterator it;

  cin >> n;
  for(int i=0; i<n; ++i){
    it=a.end();
    cin >> input;
    if(a.find(input)==it) a.insert(input);
    else                  aOverlap.insert(input);
  }
  cout << a.size()-aOverlap.size() << "\n";

  return 0;
}
0