結果
| 問題 |
No.2851 Make Pairs
|
| コンテスト | |
| ユーザー |
manabeai
|
| 提出日時 | 2024-08-25 13:43:40 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 185 ms / 2,000 ms |
| コード長 | 496 bytes |
| コンパイル時間 | 2,046 ms |
| コンパイル使用メモリ | 200,632 KB |
| 最終ジャッジ日時 | 2025-02-24 00:54:42 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 |
ソースコード
#include <bits/stdc++.h>
#ifdef DEBUG
#include "cpp-dump/dump.hpp"
#define dump(...) cpp_dump(__VA_ARGS__)
#else
#define dump(...)
#endif
using namespace std;
typedef long long ll;
void solve() {
ll n;
cin >> n;
vector<ll> A(n);
for (ll i = 0; i < n; ++i) cin >> A[i];
map<ll,ll> mp;
for (ll i = 0; i < n; ++i) mp[A[i]]++;
ll ans = 0;
for (auto m : mp) {
ans += m.second / 2;
}
cout << ans << endl;
}
int main() {
solve();
return 0;
}
manabeai