結果
問題 |
No.2851 Make Pairs
|
ユーザー |
|
提出日時 | 2024-08-20 19:21:20 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 422 bytes |
コンパイル時間 | 1,682 ms |
コンパイル使用メモリ | 126,584 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-08-20 19:21:23 |
合計ジャッジ時間 | 2,365 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 WA * 4 |
ソースコード
#include <iostream> #include <cassert> #include <vector> #include <algorithm> using namespace std; using ll = long long; int main() { int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; ++i) cin >> a[i]; assert(1 <= n && n <= 200000); for (int i = 0; i < n; ++i) assert(1 <= a[i] && a[i] <= n); sort(a.begin(), a.end()); a.erase(unique(a.begin(), a.end()), a.end()); cout << n - a.size() << endl; }