結果
| 問題 |
No.2851 Make Pairs
|
| コンテスト | |
| ユーザー |
ripity
|
| 提出日時 | 2024-08-25 13:34:01 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 76 ms / 2,000 ms |
| コード長 | 302 bytes |
| コンパイル時間 | 3,784 ms |
| コンパイル使用メモリ | 250,976 KB |
| 最終ジャッジ日時 | 2025-02-24 00:47:19 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
int main() {
int N;
cin >> N;
vector<int> cnt(N + 1);
for(int i = 0; i < N; i++) {
int a;
cin >> a;
cnt[a]++;
}
int ans = 0;
for(int x : cnt) ans += x / 2;
cout << ans << endl;
}
ripity