Detalii evaluare #57444445

Rezumat problemă

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

Detalii

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 #57444445 Utilizator Diaconu Tudor (ridiche34)
Fișier escapelight.cpp Dimensiune 2.21 KB
Data încărcării 31 Martie 2025, 18:01 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/4.8/bits/char_traits.h:39,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/istream:38,
                 from /usr/include/c++/4.8/fstream:38,
                 from escapelight.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h: In instantiation of 'struct std::pair<int, std::tuple<int, int, int> >':
escapelight.cpp:63:30:   required from here
/usr/include/c++/4.8/bits/stl_pair.h:102:11: error: 'std::pair<_T1, _T2>::second' has incomplete type
       _T2 second;                /// @c second is a copy of the second object
           ^
/usr/include/c++/4.8/bits/stl_pair.h:83:11: error: declaration of 'class std::tuple<int, int, int>'
     class tuple;
           ^
escapelight.cpp: In function 'int main()':
escapelight.cpp:63:30: error: no matching function for call to 'std::queue<std::pair<int, std::tuple<int, int, int> > >::push(<brace-enclosed initializer list>)'
  q.push({0,{xstart,ystart,1}});

                              ^
escapelight.cpp:63:30: note: candidates are:
In file included from /usr/include/c++/4.8/queue:64:0,
                 from escapelight.cpp:2:
/usr/include/c++/4.8/bits/stl_queue.h:212:7: note: void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<int, std::tuple<int, int, int> >; _Sequence = std::deque<std::pair<int, std::tuple<int, int, int> >, std::allocator<std::pair<int, std::tuple<int, int, int> > > >; std::queue<_Tp, _Sequence>::value_type = std::pair<int, std::tuple<int, int, int> >]
       push(const value_type& __x)
       ^
/usr/include/c++/4.8/bits/stl_queue.h:212:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const std::pair<int, std::tuple<int, int, int> >&}'
/usr/include/c++/4.8/bits/stl_queue.h:217:7: note: void std::queue<_Tp, _Sequence>::push(std::queue<_Tp, _Sequence>::value_type&&) [with _Tp = std::pair<int, std::tuple<int, int, int> >; _Sequence = std::deque<std::pair<int, std::tuple<int, int, int> >, std::allocator<std::pair<int, std::tuple<int, int, int> > > >; std::queue<_Tp, _Sequence>::value_type = std::pair<int, std::tuple<int, int, int> >]
       push(value_type&& __x)
       ^
/usr/include/c++/4.8/bits/stl_queue.h:217:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::queue<std::pair<int, std::tuple<int, int, int> > >::value_type&& {aka std::pair<int, std::tuple<int, int, int> >&&}'
escapelight.cpp:67:11: error: 'get' was not declared in this scope
   int x = get<0>(c.second), y = get<1>(c.second), bitmask = get<2>(c.second);

           ^
escapelight.cpp:67:20: error: 'struct std::pair<int, std::tuple<int, int, int> >' has no member named 'second'
   int x = get<0>(c.second), y = get<1>(c.second), bitmask = get<2>(c.second);

                    ^
escapelight.cpp:69:16: error: 'y' was not declared in this scope
   if (x < 0 || y < 0 || x >= n || y >= m)

                ^
escapelight.cpp:71:12: error: 'y' was not declared in this scope
   if (a[x][y].visited[bitmask])

            ^
escapelight.cpp:71:23: error: 'bitmask' was not declared in this scope
   if (a[x][y].visited[bitmask])

                       ^
escapelight.cpp:73:8: error: 'y' was not declared in this scope
   a[x][y].visited[bitmask] = 1;

        ^
escapelight.cpp:73:19: error: 'bitmask' was not declared in this scope
   a[x][y].visited[bitmask] = 1;

                   ^
escapelight.cpp:81:56: error: no matching function for call to 'std::queue<std::pair<int, std::tuple<int, int, int> > >::push(<brace-enclosed initializer list>)'
    q.push({c.first,{x,y,bitmask^(a[x][y].switchindex)}});

                                                        ^
escapelight.cpp:81:56: note: candidates are:
In file included from /usr/include/c++/4.8/queue:64:0,
                 from escapelight.cpp:2:
/usr/include/c++/4.8/bits/stl_queue.h:212:7: note: void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<int, std::tuple<int, int, int> >; _Sequence = std::deque<std::pair<int, std::tuple<int, int, int> >, std::allocator<std::pair<int, std::tuple<int, int, int> > > >; std::queue<_Tp, _Sequence>::value_type = std::pair<int, std::tuple<int, int, int> >]
       push(const value_type& __x)
       ^
/usr/include/c++/4.8/bits/stl_queue.h:212:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const std::pair<int, std::tuple<int, int, int> >&}'
/usr/include/c++/4.8/bits/stl_queue.h:217:7: note: void std::queue<_Tp, _Sequence>::push(std::queue<_Tp, _Sequence>::value_type&&) [with _Tp = std::pair<int, std::tuple<int, int, int> >; _Sequence = std::deque<std::pair<int, std::tuple<int, int, int> >, std::allocator<std::pair<int, std::tuple<int, int, int> > > >; std::queue<_Tp, _Sequence>::value_type = std::pair<int, std::tuple<int, int, int> >]
       push(value_type&& __x)
       ^
/usr/include/c++/4.8/bits/stl_queue.h:217:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::queue<std::pair<int, std::tuple<int, int, int> > >::value_type&& {aka std::pair<int, std::tuple<int, int, int> >&&}'
escapelight.cpp:97:38: error: no matching function for call to 'std::queue<std::pair<int, std::tuple<int, int, int> > >::push(<brace-enclosed initializer list>)'
    q.push({c.first+1,{x+1,y,bitmask}});

                                      ^
escapelight.cpp:97:38: note: candidates are:
In file included from /usr/include/c++/4.8/queue:64:0,
                 from escapelight.cpp:2:
/usr/include/c++/4.8/bits/stl_queue.h:212:7: note: void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<int, std::tuple<int, int, int> >; _Sequence = std::deque<std::pair<int, std::tuple<int, int, int> >, std::allocator<std::pair<int, std::tuple<int, int, int> > > >; std::queue<_Tp, _Sequence>::value_type = std::pair<int, std::tuple<int, int, int> >]
       push(const value_type& __x)
       ^
/usr/include/c++/4.8/bits/stl_queue.h:212:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const std::pair<int, std::tuple<int, int, int> >&}'
/usr/include/c++/4.8/bits/stl_queue.h:217:7: note: void std::queue<_Tp, _Sequence>::push(std::queue<_Tp, _Sequence>::value_type&&) [with _Tp = std::pair<int, std::tuple<int, int, int> >; _Sequence = std::deque<std::pair<int, std::tuple<int, int, int> >, std::allocator<std::pair<int, std::tuple<int, int, int> > > >; std::queue<_Tp, _Sequence>::value_type = std::pair<int, std::tuple<int, int, int> >]
       push(value_type&& __x)
       ^
/usr/include/c++/4.8/bits/stl_queue.h:217:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::queue<std::pair<int, std::tuple<int, int, int> > >::value_type&& {aka std::pair<int, std::tuple<int, int, int> >&&}'
escapelight.cpp:98:38: error: no matching function for call to 'std::queue<std::pair<int, std::tuple<int, int, int> > >::push(<brace-enclosed initializer list>)'
    q.push({c.first+1,{x-1,y,bitmask}});

                                      ^
escapelight.cpp:98:38: note: candidates are:
In file included from /usr/include/c++/4.8/queue:64:0,
                 from escapelight.cpp:2:
/usr/include/c++/4.8/bits/stl_queue.h:212:7: note: void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<int, std::tuple<int, int, int> >; _Sequence = std::deque<std::pair<int, std::tuple<int, int, int> >, std::allocator<std::pair<int, std::tuple<int, int, int> > > >; std::queue<_Tp, _Sequence>::value_type = std::pair<int, std::tuple<int, int, int> >]
       push(const value_type& __x)
       ^
/usr/include/c++/4.8/bits/stl_queue.h:212:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const std::pair<int, std::tuple<int, int, int> >&}'
/usr/include/c++/4.8/bits/stl_queue.h:217:7: note: void std::queue<_Tp, _Sequence>::push(std::queue<_Tp, _Sequence>::value_type&&) [with _Tp = std::pair<int, std::tuple<int, int, int> >; _Sequence = std::deque<std::pair<int, std::tuple<int, int, int> >, std::allocator<std::pair<int, std::tuple<int, int, int> > > >; std::queue<_Tp, _Sequence>::value_type = std::pair<int, std::tuple<int, int, int> >]
       push(value_type&& __x)
       ^
/usr/include/c++/4.8/bits/stl_queue.h:217:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::queue<std::pair<int, std::tuple<int, int, int> > >::value_type&& {aka std::pair<int, std::tuple<int, int, int> >&&}'
escapelight.cpp:99:38: error: no matching function for call to 'std::queue<std::pair<int, std::tuple<int, int, int> > >::push(<brace-enclosed initializer list>)'
    q.push({c.first+1,{x,y+1,bitmask}});

                                      ^
escapelight.cpp:99:38: note: candidates are:
In file included from /usr/include/c++/4.8/queue:64:0,
                 from escapelight.cpp:2:
/usr/include/c++/4.8/bits/stl_queue.h:212:7: note: void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<int, std::tuple<int, int, int> >; _Sequence = std::deque<std::pair<int, std::tuple<int, int, int> >, std::allocator<std::pair<int, std::tuple<int, int, int> > > >; std::queue<_Tp, _Sequence>::value_type = std::pair<int, std::tuple<int, int, int> >]
       push(const value_type& __x)
       ^
/usr/include/c++/4.8/bits/stl_queue.h:212:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const std::pair<int, std::tuple<int, int, int> >&}'
/usr/include/c++/4.8/bits/stl_queue.h:217:7: note: void std::queue<_Tp, _Sequence>::push(std::queue<_Tp, _Sequence>::value_type&&) [with _Tp = std::pair<int, std::tuple<int, int, int> >; _Sequence = std::deque<std::pair<int, std::tuple<int, int, int> >, std::allocator<std::pair<int, std::tuple<int, int, int> > > >; std::queue<_Tp, _Sequence>::value_type = std::pair<int, std::tuple<int, int, int> >]
       push(value_type&& __x)
       ^
/usr/include/c++/4.8/bits/stl_queue.h:217:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::queue<std::pair<int, std::tuple<int, int, int> > >::value_type&& {aka std::pair<int, std::tuple<int, int, int> >&&}'
escapelight.cpp:100:38: error: no matching function for call to 'std::queue<std::pair<int, std::tuple<int, int, int> > >::push(<brace-enclosed initializer list>)'
    q.push({c.first+1,{x,y-1,bitmask}});

                                      ^
escapelight.cpp:100:38: note: candidates are:
In file included from /usr/include/c++/4.8/queue:64:0,
                 from escapelight.cpp:2:
/usr/include/c++/4.8/bits/stl_queue.h:212:7: note: void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<int, std::tuple<int, int, int> >; _Sequence = std::deque<std::pair<int, std::tuple<int, int, int> >, std::allocator<std::pair<int, std::tuple<int, int, int> > > >; std::queue<_Tp, _Sequence>::value_type = std::pair<int, std::tuple<int, int, int> >]
       push(const value_type& __x)
       ^
/usr/include/c++/4.8/bits/stl_queue.h:212:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const std::pair<int, std::tuple<int, int, int> >&}'
/usr/include/c++/4.8/bits/stl_queue.h:217:7: note: void std::queue<_Tp, _Sequence>::push(std::queue<_Tp, _Sequence>::value_type&&) [with _Tp = std::pair<int, std::tuple<int, int, int> >; _Sequence = std::deque<std::pair<int, std::tuple<int, int, int> >, std::allocator<std::pair<int, std::tuple<int, int, int> > > >; std::queue<_Tp, _Sequence>::value_type = std::pair<int, std::tuple<int, int, int> >]
       push(value_type&& __x)
       ^
/usr/include/c++/4.8/bits/stl_queue.h:217:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::queue<std::pair<int, std::tuple<int, int, int> > >::value_type&& {aka std::pair<int, std::tuple<int, int, int> >&&}'

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema EscapeLight face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

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ă.