結果
| 問題 | No.2851 Make Pairs |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-08-25 17:30:54 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 12 ms / 2,000 ms |
| + 100µs | |
| コード長 | 498 bytes |
| 記録 | |
| コンパイル時間 | 1,470 ms |
| コンパイル使用メモリ | 210,648 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-25 08:01:42 |
| 合計ジャッジ時間 | 2,529 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 |
ソースコード
#pragma GCC optimize("O2")
#ifdef local
#include <C++/core/io/debug_print.hpp>
#else
#define dump(...) void(0);
#endif
#include <iostream>
#include <valarray>
#include <ranges>
namespace man {
}
int main() {
std::cin.tie(nullptr) -> sync_with_stdio(false);
int n;
std::cin >> n;
std::valarray<int> cnt(n + 1);
for([[maybe_unused]] const auto _: std::views::iota(0, n)) {
int a;
std::cin >> a;
cnt[a]++;
}
std::cout << (cnt / 2).sum() << '\n';
}