結果
| 問題 | No.2851 Make Pairs |
| コンテスト | |
| ユーザー |
tottoripaper
|
| 提出日時 | 2024-08-27 02:40:03 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 23 ms / 2,000 ms |
| コード長 | 385 bytes |
| 記録 | |
| コンパイル時間 | 1,045 ms |
| コンパイル使用メモリ | 215,272 KB |
| 実行使用メモリ | 16,256 KB |
| 最終ジャッジ日時 | 2026-07-05 13:37:18 |
| 合計ジャッジ時間 | 2,030 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 |
ソースコード
#include <bits/stdc++.h>
int main(){
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
int N;
std::cin >> N;
std::vector<int> count(N + 1, 0);
for(int i=0;i<N;i++){
int A;
std::cin >> A;
count[A] += 1;
}
int res = 0;
for(int i=1;i<=N;i++){
res += count[i] / 2;
}
std::cout << res << std::endl;
}
tottoripaper