#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 | #49804498 | Utilizator | |
Fișier | biom.cpp | Dimensiune | 1.39 KB |
Data încărcării | 15 Martie 2024, 12:06 | Scor / rezultat | Eroare de compilare |
biom.cpp:29:1: error: '__int128_t' does not name a type __int128_t o[1<<23]; ^ biom.cpp: In function 'int main()': biom.cpp:33:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses] in>>n>>a>>b>>c>>d>>s+1; ^ biom.cpp:35:24: warning: array subscript has type 'char' [-Wchar-subscripts] fto(i,1,n+1)p[i]=v[s[i]],v[s[i]]=i; ^ biom.cpp:35:32: warning: array subscript has type 'char' [-Wchar-subscripts] fto(i,1,n+1)p[i]=v[s[i]],v[s[i]]=i; ^ biom.cpp:37:20: warning: array subscript has type 'char' [-Wchar-subscripts] while(i)q[i]=v[s[i]],v[s[i]]=i,i--; ^ biom.cpp:37:28: warning: array subscript has type 'char' [-Wchar-subscripts] while(i)q[i]=v[s[i]],v[s[i]]=i,i--; ^ biom.cpp:39:1: error: 'o' was not declared in this scope o[l++]=1; ^ biom.cpp:42:28: error: '__int128_t' was not declared in this scope pop_heap(o,o+l,greater<__int128_t>()),l--; ^ biom.cpp:42:38: error: template argument 1 is invalid pop_heap(o,o+l,greater<__int128_t>()),l--; ^ biom.cpp:30:87: error: the value of '__int128_t' is not usable in a constant expression #define pb(x,d)if(e[x]>e[i]+d)e[x]=e[i]+d,o[l++]=x+(e[x]<<20),push_heap(o,o+l,greater<__int128_t>()) ^ biom.cpp:45:9: note: in expansion of macro 'pb' pb(i+1,a); ^ biom.cpp:42:28: note: '__int128_t' was not declared 'constexpr' pop_heap(o,o+l,greater<__int128_t>()),l--; ^ biom.cpp:30:97: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::greater' #define pb(x,d)if(e[x]>e[i]+d)e[x]=e[i]+d,o[l++]=x+(e[x]<<20),push_heap(o,o+l,greater<__int128_t>()) ^ biom.cpp:45:9: note: in expansion of macro 'pb' pb(i+1,a); ^ biom.cpp:30:97: error: expected a type, got '__int128_t' #define pb(x,d)if(e[x]>e[i]+d)e[x]=e[i]+d,o[l++]=x+(e[x]<<20),push_heap(o,o+l,greater<__int128_t>()) ^ biom.cpp:45:9: note: in expansion of macro 'pb' pb(i+1,a); ^ biom.cpp:30:87: error: the value of '__int128_t' is not usable in a constant expression #define pb(x,d)if(e[x]>e[i]+d)e[x]=e[i]+d,o[l++]=x+(e[x]<<20),push_heap(o,o+l,greater<__int128_t>()) ^ biom.cpp:46:9: note: in expansion of macro 'pb' pb(i-1,b); ^ biom.cpp:42:28: note: '__int128_t' was not declared 'constexpr' pop_heap(o,o+l,greater<__int128_t>()),l--; ^ biom.cpp:30:97: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::greater' #define pb(x,d)if(e[x]>e[i]+d)e[x]=e[i]+d,o[l++]=x+(e[x]<<20),push_heap(o,o+l,greater<__int128_t>()) ^ biom.cpp:46:9: note: in expansion of macro 'pb' pb(i-1,b); ^ biom.cpp:30:97: error: expected a type, got '__int128_t' #define pb(x,d)if(e[x]>e[i]+d)e[x]=e[i]+d,o[l++]=x+(e[x]<<20),push_heap(o,o+l,greater<__int128_t>()) ^ biom.cpp:46:9: note: in expansion of macro 'pb' pb(i-1,b); ^ biom.cpp:30:87: error: the value of '__int128_t' is not usable in a constant expression #define pb(x,d)if(e[x]>e[i]+d)e[x]=e[i]+d,o[l++]=x+(e[x]<<20),push_heap(o,o+l,greater<__int128_t>()) ^ biom.cpp:47:9: note: in expansion of macro 'pb' pb(q[i],c); ^ biom.cpp:42:28: note: '__int128_t' was not declared 'constexpr' pop_heap(o,o+l,greater<__int128_t>()),l--; ^ biom.cpp:30:97: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::greater' #define pb(x,d)if(e[x]>e[i]+d)e[x]=e[i]+d,o[l++]=x+(e[x]<<20),push_heap(o,o+l,greater<__int128_t>()) ^ biom.cpp:47:9: note: in expansion of macro 'pb' pb(q[i],c); ^ biom.cpp:30:97: error: expected a type, got '__int128_t' #define pb(x,d)if(e[x]>e[i]+d)e[x]=e[i]+d,o[l++]=x+(e[x]<<20),push_heap(o,o+l,greater<__int128_t>()) ^ biom.cpp:47:9: note: in expansion of macro 'pb' pb(q[i],c); ^ biom.cpp:30:87: error: the value of '__int128_t' is not usable in a constant expression #define pb(x,d)if(e[x]>e[i]+d)e[x]=e[i]+d,o[l++]=x+(e[x]<<20),push_heap(o,o+l,greater<__int128_t>()) ^ biom.cpp:48:9: note: in expansion of macro 'pb' pb(p[i],d); ^ biom.cpp:42:28: note: '__int128_t' was not declared 'constexpr' pop_heap(o,o+l,greater<__int128_t>()),l--; ^ biom.cpp:30:97: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::greater' #define pb(x,d)if(e[x]>e[i]+d)e[x]=e[i]+d,o[l++]=x+(e[x]<<20),push_heap(o,o+l,greater<__int128_t>()) ^ biom.cpp:48:9: note: in expansion of macro 'pb' pb(p[i],d); ^ biom.cpp:30:97: error: expected a type, got '__int128_t' #define pb(x,d)if(e[x]>e[i]+d)e[x]=e[i]+d,o[l++]=x+(e[x]<<20),push_heap(o,o+l,greater<__int128_t>()) ^ biom.cpp:48:9: note: in expansion of macro 'pb' pb(p[i],d); ^
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ă.