#4443
biom
Steve Stonecutter se află într-o lume formată din cuburi, iar fiecare cub aparține unui singur biom. Cuburile sunt dispuse într-o linie și sunt numerotate de la 1
la N
. Se consideră că blocurile i
și i + 1
sunt vecine între ele pentru toate valorile i
de la 1
la N - 1
. Putem reprezenta această lume ca și un șir de caractere S
de lungime N
format din litere mici ale alfabetului limbii engleze, numerotat de la 1
la N
, unde al i
-lea caracter reprezintă biomul din care face parte al i
-lea cub. Aceste mișcări se pot realiza dacă și numai dacă poziția în care Steve vrea să se deplaseze există. Începând de la cubul 1
, Steve dorește să ajungă la cubul N
cu cost minim, așa că vă roagă pe voi să aflați care este acest cost.
Problema | biom | Operații I/O |
![]() biom.in /biom.out
|
---|---|---|---|
Limita timp | 0.6 secunde | Limita memorie |
Total: 256 MB
/
Stivă 64 MB
|
Id soluție | #50135738 | Utilizator | |
Fișier | biom.cpp | Dimensiune | 3.01 KB |
Data încărcării | 28 Martie 2024, 10:43 | Scor / rezultat | Eroare de compilare |
biom.cpp: In function 'void dijkstra(int)': biom.cpp:49:36: error: no matching function for call to 'std::vector<nu>::push_back(<brace-enclosed initializer list>)' w.push_back({A.front()}); ^ biom.cpp:49:36: note: candidates are: In file included from /usr/include/c++/4.8/vector:64:0, from /usr/include/c++/4.8/bits/random.h:34, from /usr/include/c++/4.8/random:50, from /usr/include/c++/4.8/bits/stl_algo.h:65, from /usr/include/c++/4.8/algorithm:62, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from biom.cpp:1: /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = nu; _Alloc = std::allocator<nu>; std::vector<_Tp, _Alloc>::value_type = nu] push_back(const value_type& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const nu&}' /usr/include/c++/4.8/bits/stl_vector.h:919:7: note: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = nu; _Alloc = std::allocator<nu>; std::vector<_Tp, _Alloc>::value_type = nu] push_back(value_type&& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:919:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<nu>::value_type&& {aka nu&&}' biom.cpp:51:36: error: no matching function for call to 'std::vector<nu>::push_back(<brace-enclosed initializer list>)' w.push_back({B.front()}); ^ biom.cpp:51:36: note: candidates are: In file included from /usr/include/c++/4.8/vector:64:0, from /usr/include/c++/4.8/bits/random.h:34, from /usr/include/c++/4.8/random:50, from /usr/include/c++/4.8/bits/stl_algo.h:65, from /usr/include/c++/4.8/algorithm:62, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from biom.cpp:1: /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = nu; _Alloc = std::allocator<nu>; std::vector<_Tp, _Alloc>::value_type = nu] push_back(const value_type& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const nu&}' /usr/include/c++/4.8/bits/stl_vector.h:919:7: note: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = nu; _Alloc = std::allocator<nu>; std::vector<_Tp, _Alloc>::value_type = nu] push_back(value_type&& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:919:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<nu>::value_type&& {aka nu&&}' biom.cpp:53:36: error: no matching function for call to 'std::vector<nu>::push_back(<brace-enclosed initializer list>)' w.push_back({C.front()}); ^ biom.cpp:53:36: note: candidates are: In file included from /usr/include/c++/4.8/vector:64:0, from /usr/include/c++/4.8/bits/random.h:34, from /usr/include/c++/4.8/random:50, from /usr/include/c++/4.8/bits/stl_algo.h:65, from /usr/include/c++/4.8/algorithm:62, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from biom.cpp:1: /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = nu; _Alloc = std::allocator<nu>; std::vector<_Tp, _Alloc>::value_type = nu] push_back(const value_type& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const nu&}' /usr/include/c++/4.8/bits/stl_vector.h:919:7: note: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = nu; _Alloc = std::allocator<nu>; std::vector<_Tp, _Alloc>::value_type = nu] push_back(value_type&& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:919:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<nu>::value_type&& {aka nu&&}' biom.cpp:55:36: error: no matching function for call to 'std::vector<nu>::push_back(<brace-enclosed initializer list>)' w.push_back({D.front()}); ^ biom.cpp:55:36: note: candidates are: In file included from /usr/include/c++/4.8/vector:64:0, from /usr/include/c++/4.8/bits/random.h:34, from /usr/include/c++/4.8/random:50, from /usr/include/c++/4.8/bits/stl_algo.h:65, from /usr/include/c++/4.8/algorithm:62, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from biom.cpp:1: /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = nu; _Alloc = std::allocator<nu>; std::vector<_Tp, _Alloc>::value_type = nu] push_back(const value_type& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const nu&}' /usr/include/c++/4.8/bits/stl_vector.h:919:7: note: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = nu; _Alloc = std::allocator<nu>; std::vector<_Tp, _Alloc>::value_type = nu] push_back(value_type&& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:919:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<nu>::value_type&& {aka nu&&}' biom.cpp: In function 'int main()': biom.cpp:100:17: warning: array subscript has type 'char' [-Wchar-subscripts] if(fr[ch]) ^ biom.cpp:102:28: warning: array subscript has type 'char' [-Wchar-subscripts] v[i][4] = fr[ch]; ^ biom.cpp:103:20: warning: array subscript has type 'char' [-Wchar-subscripts] v[fr[ch]][3] = i; ^ biom.cpp:105:14: warning: array subscript has type 'char' [-Wchar-subscripts] fr[ch] = i; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema biom 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ă.