[Noti-aed] EJ2TPL3CIORCIARICONRADO

Conrado Ciorciari conrs2001 en gmail.com
Jue Nov 9 18:26:30 -03 2023


------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://venus.santafe-conicet.gov.ar/pipermail/noti-aed/attachments/20231109/7e938728/attachment.html>
------------ próxima parte ------------
#define USECHRONO
#undef HAVE_MPI

#include "eval.hpp"
#include <cassert>
#include <climits>
#include <cstdlib>
#include <stack>
using namespace aed;
using namespace std;

//---:---<*>---:---<*>- COMIENZA CODIGO FUNCION --:---<*>---:---<*>---:---<*>
// COMPLETAR DNI y NOMBRE AQUI:
// Nombre: Conrado Ciorciari
int DNI=43426610;



//---:---<*>---:---<*>---:---<*>---:---<*>---:---<*>
//Escribir una función void set3par(vector<set<int>> &VS, set<int> &S) que dado un vector de conjuntos VS, 
//debe retornar en el conjunto S, la unión de todos los juntos que tienen al menos 3 numeros pares.
  
 

bool nroPar(int x){
  return x%2==0;
}
  
void set3par(vector<set<int>> &VS, set<int> &S) {
 
  for(const auto &conjuntos:VS){
    
    int cantidad_pares=0;
    
    for(int x:conjuntos){
      if(nroPar(x)){
        cantidad_pares++;
        
        }
      }
    if(cantidad_pares>=3){
      S.insert(conjuntos.begin(),conjuntos.end());
    }
  }

  
}

//---:---<*>---:---<*>- FINALIZA CODIGO FUNCION --:---<*>---:---<*>---:---<*>
int main() {
  Eval ev;
  int vrbs=0;
  ev.eval<1>(set3par,vrbs);
  return 0;
}


Más información sobre la lista de distribución Noti-AED