#1831
Blitzcatan
În clasa a 10-a Alina, Bogdan şi Clara se întâlneau în fiecare săptămână să se joace BlitzCatan. Ei aveau la dispoziţie o repriză de 2 ore pe care o foloseau din plin, fiecare joc durând cel puţin 30 de minute. Cei trei prieteni, dornici să reţină cine a câştigat fiecare joc au vrut sa noteze într-un carneţel. Ei s-au temut ca cineva le va citi carneţelul, aşa că au procedat astfel:
i
, câştigătorul c, alege un număr secret \(m_i\) > 0
astfel încât \(m_i\) % 3 = c
(Alina alege un multiplu de 3
când câştigă, Bogdan un multiplu de 3+1
, Clara un multiplu de 3+2
)J
este numărul de jocuri, şi notează T
în carneţelProblema | Blitzcatan | Operații I/O |
![]() blitzcatan.in /blitzcatan.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 15 MB
/
Stivă 10 MB
|
Id soluție | #41431663 | Utilizator | |
Fișier | blitzcatan.cpp | Dimensiune | 2.90 KB |
Data încărcării | 23 Ianuarie 2023, 20:35 | Scor / rezultat | Eroare de compilare |
blitzcatan.cpp: In function 'int main()': blitzcatan.cpp:44:40: error: request for member 'first' in 'M.std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[]<int, int, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, int> > >((* &(fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)i)) + fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)j)))))', which is of non-class type 'std::unordered_map<int, int>::mapped_type {aka int}' M[fact[i]+fact[j]].first=i+2; ^ blitzcatan.cpp:45:40: error: request for member 'second' in 'M.std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[]<int, int, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, int> > >((* &(fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)i)) + fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)j)))))', which is of non-class type 'std::unordered_map<int, int>::mapped_type {aka int}' M[fact[i]+fact[j]].second=j+2; ^ blitzcatan.cpp:71:32: error: request for member 'first' in 'M.std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[]<int, int, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, int> > >((* &(T[e] - fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)i)))))', which is of non-class type 'std::unordered_map<int, int>::mapped_type {aka int}' if(M[T[e]-fact[i]].first>0){ ^ blitzcatan.cpp:75:34: error: request for member 'first' in 'M.std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[]<int, int, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, int> > >((* &(T[e] - fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)i)))))', which is of non-class type 'std::unordered_map<int, int>::mapped_type {aka int}' out<<M[T[e]-fact[i]].first%3<<" "; ^ blitzcatan.cpp:76:34: error: request for member 'first' in 'M.std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[]<int, int, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, int> > >((* &(T[e] - fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)i)))))', which is of non-class type 'std::unordered_map<int, int>::mapped_type {aka int}' out<<M[T[e]-fact[i]].first<<" "; ^ blitzcatan.cpp:77:34: error: request for member 'second' in 'M.std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[]<int, int, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, int> > >((* &(T[e] - fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)i)))))', which is of non-class type 'std::unordered_map<int, int>::mapped_type {aka int}' out<<M[T[e]-fact[i]].second%3<<" "; ^ blitzcatan.cpp:78:34: error: request for member 'second' in 'M.std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[]<int, int, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, int> > >((* &(T[e] - fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)i)))))', which is of non-class type 'std::unordered_map<int, int>::mapped_type {aka int}' out<<M[T[e]-fact[i]].second<<'\n'; ^ blitzcatan.cpp:87:48: error: request for member 'first' in 'M.std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[]<int, int, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, int> > >((* &((T[e] - fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)i))) - fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)j)))))', which is of non-class type 'std::unordered_map<int, int>::mapped_type {aka int}' if(M[T[e]-fact[i]-fact[j]].first>0){ ^ blitzcatan.cpp:93:54: error: request for member 'first' in 'M.std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[]<int, int, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, int> > >((* &((T[e] - fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)i))) - fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)j)))))', which is of non-class type 'std::unordered_map<int, int>::mapped_type {aka int}' out<<M[T[e]-fact[i]-fact[j]].first%3<<" "; ^ blitzcatan.cpp:94:54: error: request for member 'first' in 'M.std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[]<int, int, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, int> > >((* &((T[e] - fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)i))) - fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)j)))))', which is of non-class type 'std::unordered_map<int, int>::mapped_type {aka int}' out<<M[T[e]-fact[i]-fact[j]].first<<" "; ^ blitzcatan.cpp:95:54: error: request for member 'second' in 'M.std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[]<int, int, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, int> > >((* &((T[e] - fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)i))) - fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)j)))))', which is of non-class type 'std::unordered_map<int, int>::mapped_type {aka int}' out<<M[T[e]-fact[i]-fact[j]].second%3<<" "; ^ blitzcatan.cpp:96:54: error: request for member 'second' in 'M.std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[]<int, int, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<const int, int> > >((* &((T[e] - fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)i))) - fact.std::vector<_Tp, _Alloc>::operator[]<int, std::allocator<int> >(((std::vector<int>::size_type)j)))))', which is of non-class type 'std::unordered_map<int, int>::mapped_type {aka int}' out<<M[T[e]-fact[i]-fact[j]].second<<'\n'; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Blitzcatan 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ă.