結果

問題 No.182 新規性の虜
ユーザー wightou
提出日時 2025-06-27 05:27:08
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 70 ms / 5,000 ms
コード長 680 bytes
コンパイル時間 3,059 ms
コンパイル使用メモリ 280,828 KB
実行使用メモリ 8,320 KB
最終ジャッジ日時 2025-06-27 05:27:13
合計ジャッジ時間 5,626 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

/////////////////// メイン ///////////////////

int main () {
  
  //////////////////// 入力 ////////////////////

  int n;
  cin >> n;

  vector<int> a(n);
  for (int i=0; i<n; i++) {
    cin >> a.at(i);
  }

  //////////////// 出力変数定義 ////////////////

  int result = 0;

  //////////////////// 処理 ////////////////////

  set<int> s1;
  set<int> s2;

  for (int i : a) {
    if (s1.count(i)) s2.emplace(i);
    s1.emplace(i);
  }

  result = s1.size() - s2.size();

  //////////////////// 出力 ////////////////////

  cout << result << endl;

  //////////////////// 終了 ////////////////////

  return 0;

}
0