結果
| 問題 |
No.2851 Make Pairs
|
| コンテスト | |
| ユーザー |
Today03
|
| 提出日時 | 2024-08-29 13:29:23 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 71 ms / 2,000 ms |
| コード長 | 385 bytes |
| コンパイル時間 | 1,827 ms |
| コンパイル使用メモリ | 194,288 KB |
| 最終ジャッジ日時 | 2025-02-24 02:40:55 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9 + 10;
const ll INFL = 4e18;
int main() {
int N;
cin >> N;
vector<int> cn(N + 1);
for (int i = 0; i < N; i++) {
int a;
cin >> a;
cn[a]++;
}
int ans = 0;
for (int i = 1; i <= N; i++) {
ans += cn[i] / 2;
}
cout << ans << endl;
}
Today03