結果

問題 No.182 新規性の虜
ユーザー kaito_tateyama
提出日時 2017-08-10 14:55:01
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 415 bytes
コンパイル時間 757 ms
コンパイル使用メモリ 74,004 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-12 03:59:56
合計ジャッジ時間 4,219 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 WA * 1 RE * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int main(){


  int n,ans; cin >> n;ans = 0;
  vector<int> v(n),re(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  for (int i = 0; i < n; i++) {
    int a = v[i] - 1;
    re[a]++;
  }
  for (int i = 0; i < n; i++) {
    if(re[i] == 1){ ans++; }
  }
  cout << ans << "\n";
  return 0;
}
0