Detalii evaluare #45500312

Rezumat problemă

Să se determine, dacă este posibil, un șir de piese de domino care respectă o anumită regulă.

Lot Juniori, Sibiu 2011

Detalii

Problema Domino Operații I/O domino.in/domino.out
Limita timp 1 secunde Limita memorie Total: 64 MB / Stivă 64 MB
Id soluție #45500312 Utilizator Stan Alexandru (Ultra980)
Fișier domino.cpp Dimensiune 1.43 KB
Data încărcării 14 Octombrie 2023, 13:27 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

domino.cpp: In function 'bool* getUsedPointer(piesa)':
domino.cpp:25:5: error: 'f' was not declared in this scope
   */f

     ^
domino.cpp:26:3: error: expected ';' before 'if'
   if ( p2.first > p2.second )

   ^
domino.cpp:28:15: error: no match for 'operator[]' (operand types are 'std::unordered_map<bool, std::pair<int, int> >' and 'piesa {aka std::pair<int, int>}')
   return &used[ p2 ]; // 0-indexing vs 1-indexing

               ^
domino.cpp:28:15: note: candidates are:
In file included from /usr/include/c++/4.8/unordered_map:48:0,
                 from domino.cpp:3:
/usr/include/c++/4.8/bits/unordered_map.h:595:7: note: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type&) [with _Key = bool; _Tp = std::pair<int, int>; _Hash = std::hash<bool>; _Pred = std::equal_to<bool>; _Alloc = std::allocator<std::pair<const bool, std::pair<int, int> > >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type = std::pair<int, int>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = bool]
       operator[](const key_type& __k)
       ^
/usr/include/c++/4.8/bits/unordered_map.h:595:7: note:   no known conversion for argument 1 from 'piesa {aka std::pair<int, int>}' to 'const key_type& {aka const bool&}'
/usr/include/c++/4.8/bits/unordered_map.h:599:7: note: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type&&) [with _Key = bool; _Tp = std::pair<int, int>; _Hash = std::hash<bool>; _Pred = std::equal_to<bool>; _Alloc = std::allocator<std::pair<const bool, std::pair<int, int> > >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type = std::pair<int, int>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = bool]
       operator[](key_type&& __k)
       ^
/usr/include/c++/4.8/bits/unordered_map.h:599:7: note:   no known conversion for argument 1 from 'piesa {aka std::pair<int, int>}' to 'std::unordered_map<bool, std::pair<int, int> >::key_type&& {aka bool&&}'
domino.cpp:29:1: warning: control reaches end of non-void function [-Wreturn-type]
 }

 ^

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