map的用法
#include<iostream>
#include<map>#include<cstring>
using namespace std;
map<char,char>g;
bool right(string a, string b)
{
if(a.length()!= b.length())
return false;
else
{
for(int i = 0; i < a.length(); i++)
if(g[a[i]] != b[i])
return false;
return true;
}
}
int main()
{
g['A'] = 'T';
g['T'] = 'A';
g['C'] = 'G';
g['G'] = 'C';
int t;
cin >> t;
while(t--)
{
int n;
cin >> n;
string s[101];
for(int i = 0; i < n; i++)
cin >> s[i];
int cnt = 0;
for(int i = 0; i < n; i++)
for(int j = i+1 ; j< n; j++)
if(right(s[i], s[j]))
{
cnt++;
s[j] = "a";
break;
}
cout << cnt << endl;
}
}