結果
問題 |
No.182 新規性の虜
|
ユーザー |
![]() |
提出日時 | 2018-09-27 23:28:06 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 38 ms / 5,000 ms |
コード長 | 713 bytes |
コンパイル時間 | 664 ms |
コンパイル使用メモリ | 78,068 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-12 04:39:31 |
合計ジャッジ時間 | 1,810 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
//inlclude前用define #define _USE_MATH_DEFINES //include #include<iostream> #include<string> #include<algorithm> #include<vector> #include<cmath> #include<cstdio> #include<type_traits> #include<numeric> #include<limits> #include<iomanip> using namespace std; //typedef typedef vector<int> VI; typedef vector<string> VS; typedef vector<char> VC; //grobal変数 int main() { int n; cin >> n; VI a(n+2); for (int i = 1; i <= n; i++) cin >> a[i]; sort(a.begin()+1, a.begin()+n+1); /*for (int i = 1; i <= n; i++) { cout << a[i] << " "; }*/ int cnt = 0; for (int i = 1; i <= n; i++) { if (a[i] != a[i - 1] && a[i] != a[i + 1]) { cnt++; } } //cout << "\n"; cout << cnt << endl; return 0; }