#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: Caseda Leonardo int DNI=44839721; //---:---<*>---:---<*>---:---<*>---:---<*>---:---<*> int promedio(list &aux){ int prom = 0; for(auto it=aux.begin();it != aux.end(); it++){ prom+=*it; } int promedio=prom/aux.size(); return promedio; } list prom_sublist(list& L, int S){ list aux; if(S==0) return aux; list::iterator it2 = L.begin(); while(it2 != L.end()){ aux.push_back(*it2); int prom = promedio(aux); if(prom == S) return aux; list::iterator it1 = it2; it1++; while(it1 != L.end()) { aux.push_back(*it1); it1++; prom = promedio(aux); if(prom == S) return aux; } aux.clear(); it2++; } return aux; ///COMPLETAR! } int main() { Eval ev; int vrbs = 0; ev.eval<1>(prom_sublist,vrbs); return 0; }