結果

問題 No.182 新規性の虜
ユーザー zxc
提出日時 2016-01-18 06:05:00
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 676 bytes
コンパイル時間 651 ms
コンパイル使用メモリ 69,112 KB
実行使用メモリ 11,040 KB
最終ジャッジ日時 2024-09-19 20:23:28
合計ジャッジ時間 22,224 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 TLE * 1 -- * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iterator>
#include <algorithm>
#include <vector>

int main(){
  std::vector<int> vc;
  size_t N;
  std::cin >> N;
  vc.resize(N);
  for(auto& elm: vc ){
        std::cin>> elm;
  }
  std::vector<int> vc2;
  const int dead_value(0);
  vc2.resize(vc.size(),dead_value);
  std::sort( std::begin(vc), std::end(vc));
  std::unique_copy(std::begin(vc),std::end(vc),std::begin(vc2) );
  std::unique( std::begin(vc2), std::end(vc2) );
  size_t cnt{0};
  for(const auto& elm:vc2){
     if(elm == 0)break;
     if(1==count_if( std::begin(vc), std::end(vc) ,[=](const int i)->bool{return i==elm;})){
        cnt++;
     }
  }
  std::cout<<cnt<<std::endl;

}
0