Cod sursa(job #2614908)
Utilizator | Popescu Andrei Alexandru PopescuAndreiAlexandru | Data | 12 mai 2020 20:43:29 |
---|---|---|---|
Problema | Restante | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.51 kb |
#include <iostream>
#include <fstream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
ifstream fin("restante.in");
ofstream fout("restante.out");
int n,nr=0;
string a;
map < string, int > M;
int main()
{
fin>>n;
while(n--)
{
fin>>a;
sort(a.begin(),a.end());
M[a]++;
int ans=M[a];
if(ans==1)
nr++;
else if(ans==2)
nr--;
}
fout<<nr<<'\n';
}