結果
問題 | No.182 新規性の虜 |
ユーザー |
![]() |
提出日時 | 2017-12-06 18:12:29 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 41 ms / 5,000 ms |
コード長 | 624 bytes |
コンパイル時間 | 1,331 ms |
コンパイル使用メモリ | 89,952 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-27 20:23:41 |
合計ジャッジ時間 | 2,367 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <iomanip> #include <cmath> #include <functional> using namespace std; #define diff(x,y) ((x > y) ? (x - y) : (y - x)) #define us(x) (x > 0) ? x : x * -1 #define lli long long int int main() { int n, x = 0; cin >> n; vector <bool> ans(n,true); vector <int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a.begin(), a.end()); for (int i = 0; i < n - 1; i++) { if (a[i] == a[i + 1]) { ans[i] = false; ans[i + 1] = false; } } for (int i = 0; i < n; i++) { if (ans[i]) x++; } cout << x << endl; return 0; }