Cod sursa(job #2923698)

Utilizator IvaniciucTeodorIvaniciuc Teodor IvaniciucTeodor Data 18 septembrie 2022 10:17:48
Problema Restante Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.69 kb
#include <iostream>
#include <fstream>
#include <cstring>
#include <algorithm>
#include <cstring>
#include <vector>

using namespace std;

ifstream fin("restante.in");
ofstream fout("restante.out");

vector <string> x;

int n,c;

void read(){
	fin >> n;
	for (int i = 1; i <= n; i++)
	{
		string s; fin >> s;
		x.push_back(s);
	}

}
void verfi()
{
	for (int i = 0; i < x.size(); i++)
	{
		bool ok = true;
		do {
			for (int j = i+1; j < x.size(); j++)
				if ( x[i] == x[j]) {
					x[j]="-1";
					ok = false;
				}
			
					
		} while (next_permutation(x[i].begin(), x[i].end()));
		if (!ok)
			x[i] = "-1";
	}
}
int main(){
	read();
	verfi();
	fout<<n;

}