結果
問題 | No.182 新規性の虜 |
ユーザー |
![]() |
提出日時 | 2017-11-16 18:14:52 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 582 bytes |
コンパイル時間 | 590 ms |
コンパイル使用メモリ | 78,348 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-25 06:27:21 |
合計ジャッジ時間 | 1,779 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 12 WA * 15 |
ソースコード
#include<iostream> #include<iomanip> #include<cmath> #include<string> #include<algorithm> #include<vector> #include<math.h> #include<stack> #include <typeinfo> using namespace std; int main(void){ long long N, c; cin >> N; vector<int> v; int cnt = 0; for(int i = 0; i < N; i++){ cin >> c; v.push_back(c); } int key = v[0]; sort(v.begin(), v.end()); for(int i = 1; i < N; i++){ if(key != v[i]){ cnt++; key = v[i]; } } if(cnt > 0) cnt += 1; cout << cnt << endl; return 0; }