結果
問題 |
No.182 新規性の虜
|
ユーザー |
|
提出日時 | 2016-01-18 06:07:36 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 712 bytes |
コンパイル時間 | 796 ms |
コンパイル使用メモリ | 67,732 KB |
実行使用メモリ | 10,784 KB |
最終ジャッジ日時 | 2024-09-19 20:23:52 |
合計ジャッジ時間 | 9,972 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 TLE * 1 -- * 20 |
ソースコード
#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; }