Cod sursa(job #473426)
| Utilizator | Data | 29 iulie 2010 13:35:42 | |
|---|---|---|---|
| Problema | Restante | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <fstream>
#include <algorithm>
#include<string>
using namespace std;
string v[36111];
char s[32];
int n,sol;
int main()
{int i;
ifstream q("restante.in");
ofstream w("restante.out");
q>>n;
for(i=0;i<=n;i++)
{q>>s;
v[i]=s;
sort(v[i].begin(),v[i].end());}
sort(v,v+n);
for(i=0;i<=n;i++)
if((i==0||v[i]!=v[i-1])&&(i==n-1||v[i]!=v[i+1]))
sol++;
w<<sol<<"\n";
return 0;}
