#4806
Andrei se află într-un labirint format dintr-o matrice de camere, fiecare având unul dintre următoarele tipuri: 0
: cameră cu bec stins, 1
: cameră cu bec aprins, 2
: cameră fără bec (inaccesibilă), 3
: cameră cu întrerupător.
Camerele de tip 3
pot aprinde/stinge becurile altor camere. Andrei poate alege să apese sau nu întrerupătoarele întâlnite. El pornește dintr-o cameră dată și trebuie să ajungă într-o cameră destinație, deplasându-se doar prin camere aprinse.
Se cere determinarea distanței minime pentru a ajunge la destinație.
Concursul Național de Matematică și Informatică Grigore Moisil
Problema | EscapeLight | Operații I/O |
![]() escapelight.in /escapelight.out
|
---|---|---|---|
Limita timp | 0.7 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #57444493 | Utilizator | |
Fișier | escapelight.cpp | Dimensiune | 2.23 KB |
Data încărcării | 31 Martie 2025, 18:02 | Scor / rezultat | Eroare de compilare |
escapelight.cpp: In function 'int main()': escapelight.cpp:64:30: error: converting to 'const std::tuple<int, int, int>' from initializer list would use explicit constructor 'constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {int&, int&, int}; <template-parameter-2-2> = void; _Elements = {int, int, int}]' q.push({1,{xstart,ystart,0}}); ^ escapelight.cpp:82:56: error: converting to 'const std::tuple<int, int, int>' from initializer list would use explicit constructor 'constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {int&, int&, int}; <template-parameter-2-2> = void; _Elements = {int, int, int}]' q.push({c.first,{x,y,bitmask^(a[x][y].switchindex)}}); ^ escapelight.cpp:98:38: error: converting to 'const std::tuple<int, int, int>' from initializer list would use explicit constructor 'constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {int, int&, int&}; <template-parameter-2-2> = void; _Elements = {int, int, int}]' q.push({c.first+1,{x+1,y,bitmask}}); ^ escapelight.cpp:99:38: error: converting to 'const std::tuple<int, int, int>' from initializer list would use explicit constructor 'constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {int, int&, int&}; <template-parameter-2-2> = void; _Elements = {int, int, int}]' q.push({c.first+1,{x-1,y,bitmask}}); ^ escapelight.cpp:100:38: error: converting to 'const std::tuple<int, int, int>' from initializer list would use explicit constructor 'constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {int&, int, int&}; <template-parameter-2-2> = void; _Elements = {int, int, int}]' q.push({c.first+1,{x,y+1,bitmask}}); ^ escapelight.cpp:101:38: error: converting to 'const std::tuple<int, int, int>' from initializer list would use explicit constructor 'constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {int&, int, int&}; <template-parameter-2-2> = void; _Elements = {int, int, int}]' q.push({c.first+1,{x,y-1,bitmask}}); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema EscapeLight 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ă.