Detalii evaluare #64138411

Rezumat problemă

Gigel are o livadă împărțită în n*m sectoare, dispuse pe n linii, numeroate de la 1 la n și m coloane, numerotate de la 1 la m. În fiecare sector se află un cireș, care conține o cantitate de cireșe cunoscută. Gigel va culege toate cireșele din cireșii dispuși într-o zonă dreptunghiulară din livadă. El poate să aleagă între k zone și dorește să culeagă cât mai multe cireșe.

Scrieți un program care determină cantitatea maximă de cireșe pe care o poate culege Gigel din una dintre cele k zone date.

Detalii

Problema Cirese Operații I/O tastatură/ecran
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #64138411 Utilizator Iuoras Andrei (IuorasAndrei)
Fișier cirese.cpp Dimensiune 7.61 KB
Data încărcării 20 Aprilie 2026, 09:08 Scor/rezultat Eroare de compilare

Evaluare

Mesaj compilare

cirese.cpp: In member function ‘void Dst::build(std::vector<long long int>&)’:
cirese.cpp:119:27: error: use of ‘auto’ in lambda parameter declaration only available with ‘-std=c++14’ or ‘-std=gnu++14’
  119 |         auto build_ = [&](auto& self, ll level, ll l, ll r)->void
      |                           ^~~~
cirese.cpp: In lambda function:
cirese.cpp:135:21: error: expression cannot be used as a function
  135 |                 self(self, level-1, l, mid);
      |                 ~~~~^~~~~~~~~~~~~~~~~~~~~~~
cirese.cpp:136:21: error: expression cannot be used as a function
  136 |                 self(self, level-1, mid+1, r);
      |                 ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
cirese.cpp: In member function ‘void Dst::build(std::vector<long long int>&)’:
cirese.cpp:139:15: error: no match for call to ‘(Dst::build(std::vector<long long int>&)::<lambda(int&, long long int, long long int, long long int)>) (Dst::build(std::vector<long long int>&)::<lambda(int&, long long int, long long int, long long int)>&, long long int&, int, long long int)’
  139 |         build_(build_, maxlevel, 0, (1ll<<maxlevel)-1);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cirese.cpp:119:23: note: candidate: ‘Dst::build(std::vector<long long int>&)::<lambda(int&, long long int, long long int, long long int)>’
  119 |         auto build_ = [&](auto& self, ll level, ll l, ll r)->void
      |                       ^
cirese.cpp:119:23: note:   no known conversion for argument 1 from ‘Dst::build(std::vector<long long int>&)::<lambda(int&, long long int, long long int, long long int)>’ to ‘int&’
cirese.cpp: In member function ‘void Dst::build(const Dst&, const Dst&)’:
cirese.cpp:147:27: error: use of ‘auto’ in lambda parameter declaration only available with ‘-std=c++14’ or ‘-std=gnu++14’
  147 |         auto build_ = [&](auto& self, ll level, ll l, ll r)->void
      |                           ^~~~
cirese.cpp: In lambda function:
cirese.cpp:163:21: error: expression cannot be used as a function
  163 |                 self(self, level-1, l, mid);
      |                 ~~~~^~~~~~~~~~~~~~~~~~~~~~~
cirese.cpp:164:21: error: expression cannot be used as a function
  164 |                 self(self, level-1, mid+1, r);
      |                 ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
cirese.cpp: In member function ‘void Dst::build(const Dst&, const Dst&)’:
cirese.cpp:167:15: error: no match for call to ‘(Dst::build(const Dst&, const Dst&)::<lambda(int&, long long int, long long int, long long int)>) (Dst::build(const Dst&, const Dst&)::<lambda(int&, long long int, long long int, long long int)>&, long long int&, int, long long int)’
  167 |         build_(build_, maxlevel, 0, (1ll<<maxlevel)-1);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cirese.cpp:147:23: note: candidate: ‘Dst::build(const Dst&, const Dst&)::<lambda(int&, long long int, long long int, long long int)>’
  147 |         auto build_ = [&](auto& self, ll level, ll l, ll r)->void
      |                       ^
cirese.cpp:147:23: note:   no known conversion for argument 1 from ‘Dst::build(const Dst&, const Dst&)::<lambda(int&, long long int, long long int, long long int)>’ to ‘int&’
cirese.cpp: In member function ‘void Dst2D::build(std::vector<std::vector<long long int> >&)’:
cirese.cpp:191:27: error: use of ‘auto’ in lambda parameter declaration only available with ‘-std=c++14’ or ‘-std=gnu++14’
  191 |         auto build_ = [&](auto& self, ll level, ll l, ll r)->void
      |                           ^~~~
cirese.cpp: In lambda function:
cirese.cpp:198:21: error: expression cannot be used as a function
  198 |                 self(self, level-1, l, mid);
      |                 ~~~~^~~~~~~~~~~~~~~~~~~~~~~
cirese.cpp:199:21: error: expression cannot be used as a function
  199 |                 self(self, level-1, mid+1, r);
      |                 ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
cirese.cpp: In member function ‘void Dst2D::build(std::vector<std::vector<long long int> >&)’:
cirese.cpp:215:15: error: no match for call to ‘(Dst2D::build(std::vector<std::vector<long long int> >&)::<lambda(int&, long long int, long long int, long long int)>) (Dst2D::build(std::vector<std::vector<long long int> >&)::<lambda(int&, long long int, long long int, long long int)>&, long long int&, int, long long int)’
  215 |         build_(build_, maxlevel, 0, (1ll<<maxlevel)-1);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cirese.cpp:191:23: note: candidate: ‘Dst2D::build(std::vector<std::vector<long long int> >&)::<lambda(int&, long long int, long long int, long long int)>’
  191 |         auto build_ = [&](auto& self, ll level, ll l, ll r)->void
      |                       ^
cirese.cpp:191:23: note:   no known conversion for argument 1 from ‘Dst2D::build(std::vector<std::vector<long long int> >&)::<lambda(int&, long long int, long long int, long long int)>’ to ‘int&’

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema Cirese face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.

Du-te sus!