File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /* *
2+ * @file 2037A.cpp
3+ * @author Macesuted (i@macesuted.moe)
4+ * @date 2026-04-25
5+ *
6+ * @copyright Copyright (c) 2026
7+ *
8+ */
9+
10+ #include < bits/stdc++.h>
11+ using namespace std ;
12+
13+ #ifndef LOCAL
14+ #define endl ' \n '
15+ #endif
16+
17+ bool mem1;
18+
19+ void solve (void ) {
20+ int n;
21+ cin >> n;
22+
23+ map<int , int > S;
24+ for (int i = 1 , x; i <= n; i++) cin >> x, S[x]++;
25+
26+ int ans = 0 ;
27+ for (auto [v, c] : S) ans += c >> 1 ;
28+
29+ cout << ans << endl;
30+
31+ return ;
32+ }
33+
34+ bool mem2;
35+
36+ int main () {
37+ ios::sync_with_stdio (false ), cin.tie (nullptr );
38+ #ifdef LOCAL
39+ cerr << " Memory Cost: " << abs (&mem1 - &mem2) / 1024 . / 1024 . << " MB" << endl;
40+ #endif
41+
42+ int _ = 1 ;
43+ cin >> _;
44+ while (_--) solve ();
45+
46+ #ifdef LOCAL
47+ cerr << " Time Cost: " << clock () * 1000 . / CLOCKS_PER_SEC << " MS" << endl;
48+ #endif
49+ return 0 ;
50+ }
You can’t perform that action at this time.
0 commit comments