結果

問題 No.182 新規性の虜
ユーザー satanicsatanic
提出日時 2015-12-06 15:07:22
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 55 ms / 5,000 ms
コード長 427 bytes
コンパイル時間 440 ms
コンパイル使用メモリ 59,740 KB
実行使用メモリ 8,068 KB
最終ジャッジ日時 2023-08-27 07:39:18
合計ジャッジ時間 2,189 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 31 ms
5,872 KB
testcase_09 AC 55 ms
7,396 KB
testcase_10 AC 47 ms
6,856 KB
testcase_11 AC 37 ms
6,204 KB
testcase_12 AC 14 ms
4,864 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 32 ms
4,380 KB
testcase_19 AC 23 ms
4,380 KB
testcase_20 AC 15 ms
4,380 KB
testcase_21 AC 36 ms
4,448 KB
testcase_22 AC 19 ms
4,376 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 45 ms
8,068 KB
testcase_25 AC 8 ms
4,380 KB
testcase_26 AC 7 ms
4,380 KB
testcase_27 AC 2 ms
4,380 KB
evil01.txt AC 47 ms
8,140 KB
evil02.txt AC 47 ms
8,216 KB
権限があれば一括ダウンロードができます

ソースコード

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