Skip to content

Commit 80a3cd5

Browse files
committed
Codeforces: Twice
1 parent 63e7726 commit 80a3cd5

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

Codeforces/2037A.cpp

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+
}

0 commit comments

Comments
 (0)