#2684
hard_ssc
Se dă un șir de n
numere naturale. Să se determine numărul minim de subșiruri strict crescătoare în care se poate partiționa șirul.
Classic Greedy
Problema | hard_ssc | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54517205 | Utilizator | |
Fișier | hard_ssc.cpp | Dimensiune | 1.16 KB |
Data încărcării | 01 Decembrie 2024, 10:51 | Scor / rezultat | Eroare de compilare |
hard_ssc.cpp: In function 'int main()': hard_ssc.cpp:23:52: error: parameter declared 'auto' for_each(v1.begin(), v1.end(), [&](const auto& y) ^ hard_ssc.cpp: In lambda function: hard_ssc.cpp:26:32: error: 'y' was not declared in this scope v2.push_back(make_pair(y, j++)); ^ hard_ssc.cpp: In function 'int main()': hard_ssc.cpp:30:52: error: parameter declared 'auto' for_each(v2.begin(), v2.end(), [&](const auto& y) ^ hard_ssc.cpp: In lambda function: hard_ssc.cpp:33:12: error: 'y' was not declared in this scope v3[y.second] = j++; ^ hard_ssc.cpp: In function 'int main()': hard_ssc.cpp:35:52: error: parameter declared 'auto' for_each(v2.begin(), v2.end(), [&](const auto& y) ^ hard_ssc.cpp: In lambda function: hard_ssc.cpp:37:18: error: 'y' was not declared in this scope if(!b[v3[y.second]]) ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from hard_ssc.cpp:2: /usr/include/c++/4.8/bits/stl_algo.h: In instantiation of '_Funct std::for_each(_IIter, _IIter, _Funct) [with _IIter = __gnu_cxx::__normal_iterator<unsigned int*, std::vector<unsigned int> >; _Funct = main()::__lambda4]': hard_ssc.cpp:27:6: required from here /usr/include/c++/4.8/bits/stl_algo.h:4417:14: error: no match for call to '(main()::__lambda4) (unsigned int&)' __f(*__first); ^ hard_ssc.cpp:23:38: note: candidates are: for_each(v1.begin(), v1.end(), [&](const auto& y) ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from hard_ssc.cpp:2: /usr/include/c++/4.8/bits/stl_algo.h:4417:14: note: void (*)() <conversion> __f(*__first); ^ /usr/include/c++/4.8/bits/stl_algo.h:4417:14: note: candidate expects 1 argument, 2 provided hard_ssc.cpp:23:53: note: main()::__lambda4 for_each(v1.begin(), v1.end(), [&](const auto& y) ^ hard_ssc.cpp:23:53: note: candidate expects 0 arguments, 1 provided In file included from /usr/include/c++/4.8/algorithm:62:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from hard_ssc.cpp:2: /usr/include/c++/4.8/bits/stl_algo.h: In instantiation of '_Funct std::for_each(_IIter, _IIter, _Funct) [with _IIter = __gnu_cxx::__normal_iterator<std::pair<unsigned int, unsigned int>*, std::vector<std::pair<unsigned int, unsigned int> > >; _Funct = main()::__lambda5]': hard_ssc.cpp:34:6: required from here /usr/include/c++/4.8/bits/stl_algo.h:4417:14: error: no match for call to '(main()::__lambda5) (std::pair<unsigned int, unsigned int>&)' __f(*__first); ^ hard_ssc.cpp:30:38: note: candidates are: for_each(v2.begin(), v2.end(), [&](const auto& y) ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from hard_ssc.cpp:2: /usr/include/c++/4.8/bits/stl_algo.h:4417:14: note: void (*)() <conversion> __f(*__first); ^ /usr/include/c++/4.8/bits/stl_algo.h:4417:14: note: candidate expects 1 argument, 2 provided hard_ssc.cpp:30:53: note: main()::__lambda5 for_each(v2.begin(), v2.end(), [&](const auto& y) ^ hard_ssc.cpp:30:53: note: candidate expects 0 arguments, 1 provided In file included from /usr/include/c++/4.8/algorithm:62:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from hard_ssc.cpp:2: /usr/include/c++/4.8/bits/stl_algo.h: In instantiation of '_Funct std::for_each(_IIter, _IIter, _Funct) [with _IIter = __gnu_cxx::__normal_iterator<std::pair<unsigned int, unsigned int>*, std::vector<std::pair<unsigned int, unsigned int> > >; _Funct = main()::__lambda6]': hard_ssc.cpp:51:6: required from here /usr/include/c++/4.8/bits/stl_algo.h:4417:14: error: no match for call to '(main()::__lambda6) (std::pair<unsigned int, unsigned int>&)' __f(*__first); ^ hard_ssc.cpp:35:38: note: candidates are: for_each(v2.begin(), v2.end(), [&](const auto& y) ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from hard_ssc.cpp:2: /usr/include/c++/4.8/bits/stl_algo.h:4417:14: note: void (*)() <conversion> __f(*__first); ^ /usr/include/c++/4.8/bits/stl_algo.h:4417:14: note: candidate expects 1 argument, 2 provided hard_ssc.cpp:35:53: note: main()::__lambda6 for_each(v2.begin(), v2.end(), [&](const auto& y) ^ hard_ssc.cpp:35:53: note: candidate expects 0 arguments, 1 provided
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema hard_ssc face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
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ă.