結果

問題 No.2851 Make Pairs
ユーザー forest3
提出日時 2025-01-23 16:49:02
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 348 bytes
コンパイル時間 1,623 ms
コンパイル使用メモリ 171,616 KB
実行使用メモリ 12,672 KB
最終ジャッジ日時 2025-01-23 16:49:05
合計ジャッジ時間 3,160 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/math>
using namespace atcoder;

#define rep(i, n) for( ll i = 0; i < n; i++ )
using ll = long long;

int main() {
	int N;
	cin >> N;
	map<int, int> mp;
	rep(i, N) {
		int a;
		cin >> a;
		mp[a]++;
	}
	int ans = 0;
	for(auto p : mp) {
		ans += p.second / 2;
	}
	cout << ans << endl;
}
0