#define USECHRONO #undef HAVE_MPI #include "eval.hpp" #include #include #include #include #include using namespace aed; using namespace std; //---:---<*>---:---<*>- COMIENZA CODIGO FUNCION --:---<*>---:---<*>---:---<*> // COMPLETAR DNI y NOMBRE AQUI: // Nombre: Jorge Palacios int DNI=43644738; //---:---<*>---:---<*>---:---<*>---:---<*>---:---<*> list>getSublists(list&a){ list>subl = {}; for (auto it1 = a.begin(); it1 != a.end(); it1++){ auto it2 = it1; while (it2 != a.end()){ it2++; subl.push_back({it1, it2}); } } return subl; } int getProm(list&S){ float sum = 0; auto it = S.begin(); while(it != S.end()){ sum += *it; it++; } return sum/S.size(); } bool sumprom(list&L,int prom){ auto it = L.begin(); int promedioL = getProm(L); if(promedioL == prom){ return true; } return false; } list prom_sublist(list& L, int S){ list b = {}; if(S == 0){ return b; } list>allSubs = {}; allSubs = getSublists(L); auto it = allSubs.begin(); while(it != allSubs.end()){ if(sumprom(*it,S)){ return *it; } it++; } return b; } int main() { Eval ev; int vrbs = 0; ev.eval<1>(prom_sublist,vrbs); return 0; }