結果

問題 No.182 新規性の虜
ユーザー zxczxc
提出日時 2016-01-18 06:07:36
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 712 bytes
コンパイル時間 587 ms
コンパイル使用メモリ 68,556 KB
実行使用メモリ 8,320 KB
最終ジャッジ日時 2023-10-20 00:34:46
合計ジャッジ時間 10,216 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 2,940 ms
4,348 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
evil01.txt -- -
evil02.txt -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
  std::cout.sync_with_stdio(false);
  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