結果
| 問題 | No.2851 Make Pairs |
| コンテスト | |
| ユーザー |
テナガザル
|
| 提出日時 | 2024-08-25 13:33:06 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 37 ms / 2,000 ms |
| + 603µs | |
| コード長 | 312 bytes |
| 記録 | |
| コンパイル時間 | 1,080 ms |
| コンパイル使用メモリ | 167,140 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-25 05:16:03 |
| 合計ジャッジ時間 | 2,507 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> cnt(n);
for (int i = 0; i < n; ++i)
{
int a;
cin >> a;
--a;
++cnt[a];
}
int ans = 0;
for (int i = 0; i < n; ++i) ans += cnt[i] / 2;
cout << ans << endl;
}
テナガザル