[Noti-aed] Ej1-TPL3

Maxi Brandolin maxibrandolin en gmail.com
Jue Nov 9 20:13:12 -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/f3ec4927/attachment.html>
------------ próxima parte ------------
#define USECHRONO
#undef HAVE_MPI

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

//---:---<*>---:---<*>- COMIENZA CODIGO FUNCION --:---<*>---:---<*>---:---<*>
// COMPLETAR DNI y NOMBRE AQUI:
// Nombre: Brandolin Maximiliano
int DNI=44903889;



//---:---<*>---:---<*>---:---<*>---:---<*>---:---<*>

bool esPar(int x){
  if(x%2 == 0){
    return true;
  }
  return false;
}

void set3par(vector<set<int>> &VS, set<int> &S) {
  auto it = VS.begin();
  auto itS = S.begin();
  while(it != VS.end()){
    auto itSS = (*it).begin();
    if(count_if((*it).begin(), (*it).end(), *esPar) >= 3){
      while(itSS != (*it).end()){
        itS = S.insert(itS, *itSS);
        itSS++;
      }
    }
    it++;
  }
}

//---:---<*>---:---<*>- 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