結果

問題 No.2851 Make Pairs
ユーザー Daniel K
提出日時 2024-08-25 13:42:05
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 594 bytes
コンパイル時間 1,136 ms
コンパイル使用メモリ 114,704 KB
最終ジャッジ日時 2025-02-24 00:53:14
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <utility>
#include <sstream>
#include <queue>
#include <queue>

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  map<int, int> counts;
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int v;
    cin >> v;
    counts[v]++;
  }

  int sum = 0;
  for (const auto &el: counts) {
    sum += el.second / 2;
  }
  cout << sum << endl;

  return 0;
}
0