#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 | #58303231 | Utilizator | |
Fișier | biom.cpp | Dimensiune | 1.88 KB |
Data încărcării | 26 Mai 2025, 10:34 | Scor / rezultat | 86 puncte |
biom.cpp: In function 'void dijkstra()': biom.cpp:50:35: warning: narrowing conversion of 'dp.std::vector<_Tp, _Alloc>::operator[]<long long int, std::allocator<long long int> >(((std::vector<long long int>::size_type)urm))' from '__gnu_cxx::__alloc_traits<std::allocator<long long int> >::value_type {aka long long int}' to 'int' inside { } [-Wnarrowing] pq.push({urm, dp[urm]}); ^ biom.cpp:57:35: warning: narrowing conversion of 'dp.std::vector<_Tp, _Alloc>::operator[]<long long int, std::allocator<long long int> >(((std::vector<long long int>::size_type)ant))' from '__gnu_cxx::__alloc_traits<std::allocator<long long int> >::value_type {aka long long int}' to 'int' inside { } [-Wnarrowing] pq.push({ant, dp[ant]}); ^ biom.cpp:64:35: warning: narrowing conversion of 'dp.std::vector<_Tp, _Alloc>::operator[]<long long int, std::allocator<long long int> >(((std::vector<long long int>::size_type)drm))' from '__gnu_cxx::__alloc_traits<std::allocator<long long int> >::value_type {aka long long int}' to 'int' inside { } [-Wnarrowing] pq.push({drm, dp[drm]}); ^ biom.cpp:71:35: warning: narrowing conversion of 'dp.std::vector<_Tp, _Alloc>::operator[]<long long int, std::allocator<long long int> >(((std::vector<long long int>::size_type)stm))' from '__gnu_cxx::__alloc_traits<std::allocator<long long int> >::value_type {aka long long int}' to 'int' inside { } [-Wnarrowing] pq.push({stm, dp[stm]}); ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0.004 secunde | OK. | 3 | 3 | ||
2 | 0.004 secunde | OK. | 4 | 4 | ||
3 | 0.004 secunde | OK. | 4 | 4 | ||
4 | 0.004 secunde | OK. | 4 | 4 | ||
5 | 0.072 secunde | OK. | 4 | 4 | ||
6 | 0.28 secunde | OK. | 5 | 5 | ||
7 | 0.156 secunde | OK. | 5 | 5 | ||
8 | 0.148 secunde | OK. | 5 | 5 | ||
9 | 0.288 secunde | OK. | 2 | 2 | ||
10 | 0.216 secunde | OK. | 2 | 2 | ||
11 | 0.356 secunde | OK. | 2 | 2 | ||
12 | 0.268 secunde | OK. | 2 | 2 | ||
13 | 0.268 secunde | OK. | 2 | 2 | ||
14 | 0.024 secunde | OK. | 1 | 1 | ||
15 | 0.02 secunde | OK. | 1 | 1 | ||
16 | 0.028 secunde | OK. | 1 | 1 | ||
17 | 0.028 secunde | OK. | 1 | 1 | ||
18 | 0.028 secunde | OK. | 2 | 2 | ||
19 | 0.024 secunde | OK. | 2 | 2 | ||
20 | 0.232 secunde | OK. | 2 | 2 | ||
21 | 0.18 secunde | OK. | 2 | 2 | ||
22 | 0.164 secunde | OK. | 2 | 2 | ||
23 | 0.124 secunde | OK. | 2 | 2 | ||
24 | 0.052 secunde | OK. | 3 | 3 | ||
25 | 0.168 secunde | OK. | 1 | 1 | ||
26 | 0.184 secunde | OK. | 1 | 1 | ||
27 | 0.28 secunde | OK. | 1 | 1 | ||
28 | 0.044 secunde | Raspuns gresit. | 1 | 0 | ||
29 | 0.044 secunde | Raspuns gresit. | 1 | 0 | ||
30 | 0.236 secunde | OK. | 1 | 1 | ||
31 | 0.372 secunde | OK. | 1 | 1 | ||
32 | 0.364 secunde | OK. | 2 | 2 | ||
33 | 0.372 secunde | OK. | 2 | 2 | ||
34 | 0.368 secunde | OK. | 2 | 2 | ||
35 | 0.36 secunde | OK. | 2 | 2 | ||
36 | 0.396 secunde | OK. | 2 | 2 | ||
37 | 0.004 secunde | Raspuns gresit. | 2 | 0 | ||
38 | 0.012 secunde | Raspuns gresit. | 2 | 0 | ||
39 | 0.012 secunde | Raspuns gresit. | 2 | 0 | ||
40 | 0.012 secunde | Raspuns gresit. | 2 | 0 | ||
41 | 0.004 secunde | OK. | 2 | 2 | ||
42 | 0.004 secunde | OK. | 2 | 2 | ||
43 | 0.004 secunde | Raspuns gresit. | 2 | 0 | ||
44 | 0.004 secunde | Raspuns gresit. | 2 | 0 | ||
45 | 0.004 secunde | OK. | 2 | 2 | ||
46 | 0.004 secunde | OK. | 2 | 2 | ||
Punctaj total | 86 |
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ă.