#define USECHRONO #undef HAVE_MPI #include "eval.hpp" #include #include #include #include using namespace aed; using namespace std; //---:---<*>---:---<*>- COMIENZA CODIGO FUNCION --:---<*>---:---<*>---:---<*> // COMPLETAR DNI y NOMBRE AQUI: // Nombre: Ramos Patricio int DNI=42476835; void set_union(set &A,set &B,set &C){ C.insert(A.begin(),A.end()); C.insert(B.begin(),B.end()); } bool esPrimo(int elemento){ if (elemento == 0 || elemento == 1 || elemento == 4) return false; for (int x = 2; x < elemento / 2; x++) { if (elemento % x == 0) return false; } return true; } bool contienePrimo(set conjunto){ for(auto elemento : conjunto){ if(esPrimo(elemento)){ return true; } } return false; } void set_prime(vector> &VS, set &S) { for (auto conjunto : VS) { if(contienePrimo(conjunto)){ set_union(S,conjunto,S); } } } //---:---<*>---:---<*>- FINALIZA CODIGO FUNCION --:---<*>---:---<*>---:---<*> int main() { Eval ev; int vrbs=0; ev.eval<1>(set_prime,vrbs); return 0; }