Cod sursa(job #341403)
| Utilizator | Data | 18 august 2009 14:12:52 | |
|---|---|---|---|
| Problema | Restante | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <fstream>
#include <map>
#include <string>
#include <algorithm>
using namespace std;
map<string,int> h;
ifstream fin("restante.in");
ofstream fout("restante.out");
int main()
{
int n,i,nrsol = 0;
string s;
fin >> n;
for (i=0;i<n;i++)
{
fin >> s;
sort(s.begin(),s.end());
if (h[s] == 1)
{
nrsol--;
h[s] = 2;
}
else if (h[s] == 0)
{
h[s] = 1;
nrsol++;
}
}
fout << nrsol;
return 0;
}