Skip to content

Instantly share code, notes, and snippets.

@likecs
Last active November 20, 2017 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save likecs/96fbb342e1feb64f7aa10e72f20a9bcd to your computer and use it in GitHub Desktop.
Save likecs/96fbb342e1feb64f7aa10e72f20a9bcd to your computer and use it in GitHub Desktop.
Model Solution of GEEK03
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
int t, n;
cin >> t;
assert(1 <= t && t <= 10);
while(t--) {
cin >> n;
assert(1 <= n && n <= 100);
vector<string> a(n);
for(int i = 0; i < n; ++i) {
cin >> a[i];
assert(a[i].length() <= 10);
}
sort(a.begin(), a.end());
int ans = 0;
for(int i = 0; i < n; ++i) {
int j = i;
while(j < n && a[i] == a[j]) {
j += 1;
}
if ((j - i) % 2 == 1) {
ans += 1;
}
i = j - 1;
}
cout << ans << "\n";
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment