Detalii evaluare #64047112

Rezumat problemă

#873

Se dau dau două vase cu capacitatea A, respectiv B litri. Se cere să se măsoare cu ajutorul lor C litri de apă.

Detalii

Problema Vase Operații I/O tastatură/ecran
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #64047112 Utilizator Serban Ursachi (juvero)
Fișier vase.cpp Dimensiune 2.18 KB
Data încărcării 13 Aprilie 2026, 13:15 Scor/rezultat Eroare de compilare

Evaluare

Mesaj compilare

vase.cpp: In function 'int main()':
vase.cpp:19:14: error: expected unqualified-id before '[' token
         auto [x,y]=q.front();

              ^
vase.cpp:21:12: error: 'x' was not declared in this scope
         if(x==c||y==c)

            ^
vase.cpp:21:18: error: 'y' was not declared in this scope
         if(x==c||y==c)

                  ^
vase.cpp:23:17: error: no match for 'operator=' (operand types are 'std::pair<int, int>' and '<brace-enclosed initializer list>')
             end = {x,y};

                 ^
vase.cpp:23:17: note: candidates are:
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from vase.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:158:7: note: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_T1, _T2>&) [with _T1 = int; _T2 = int]
       operator=(const pair& __p)
       ^
/usr/include/c++/4.8/bits/stl_pair.h:158:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::pair<int, int>&'
/usr/include/c++/4.8/bits/stl_pair.h:166:7: note: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_T1, _T2>&&) [with _T1 = int; _T2 = int]
       operator=(pair&& __p)
       ^
/usr/include/c++/4.8/bits/stl_pair.h:166:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::pair<int, int>&&'
/usr/include/c++/4.8/bits/stl_pair.h:177:2: note: template<class _U1, class _U2> std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U1 = _U1; _U2 = _U2; _T1 = int; _T2 = int]
  operator=(const pair<_U1, _U2>& __p)
  ^
/usr/include/c++/4.8/bits/stl_pair.h:177:2: note:   template argument deduction/substitution failed:
vase.cpp:23:17: note:   couldn't deduce template parameter '_U1'
             end = {x,y};

                 ^
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from vase.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:186:2: note: template<class _U1, class _U2> std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U1 = _U1; _U2 = _U2; _T1 = int; _T2 = int]
  operator=(pair<_U1, _U2>&& __p)
  ^
/usr/include/c++/4.8/bits/stl_pair.h:186:2: note:   template argument deduction/substitution failed:
vase.cpp:23:17: note:   couldn't deduce template parameter '_U1'
             end = {x,y};

                 ^
vase.cpp:28:17: error: 'y' was not declared in this scope
         nx=a,ny=y;

                 ^
vase.cpp:32:30: error: 'x' was not declared in this scope
             parent[nx][ny]= {x,y};

                              ^
vase.cpp:32:27: error: no match for 'operator=' (operand types are 'std::pair<int, int>' and '<brace-enclosed initializer list>')
             parent[nx][ny]= {x,y};

                           ^
vase.cpp:32:27: note: candidates are:
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from vase.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:158:7: note: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_T1, _T2>&) [with _T1 = int; _T2 = int]
       operator=(const pair& __p)
       ^
/usr/include/c++/4.8/bits/stl_pair.h:158:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::pair<int, int>&'
/usr/include/c++/4.8/bits/stl_pair.h:166:7: note: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_T1, _T2>&&) [with _T1 = int; _T2 = int]
       operator=(pair&& __p)
       ^
/usr/include/c++/4.8/bits/stl_pair.h:166:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::pair<int, int>&&'
/usr/include/c++/4.8/bits/stl_pair.h:177:2: note: template<class _U1, class _U2> std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U1 = _U1; _U2 = _U2; _T1 = int; _T2 = int]
  operator=(const pair<_U1, _U2>& __p)
  ^
/usr/include/c++/4.8/bits/stl_pair.h:177:2: note:   template argument deduction/substitution failed:
vase.cpp:32:27: note:   couldn't deduce template parameter '_U1'
             parent[nx][ny]= {x,y};

                           ^
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from vase.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:186:2: note: template<class _U1, class _U2> std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U1 = _U1; _U2 = _U2; _T1 = int; _T2 = int]
  operator=(pair<_U1, _U2>&& __p)
  ^
/usr/include/c++/4.8/bits/stl_pair.h:186:2: note:   template argument deduction/substitution failed:
vase.cpp:32:27: note:   couldn't deduce template parameter '_U1'
             parent[nx][ny]= {x,y};

                           ^
vase.cpp:37:12: error: 'x' was not declared in this scope
         nx=x,ny=b;

            ^
vase.cpp:41:27: error: no match for 'operator=' (operand types are 'std::pair<int, int>' and '<brace-enclosed initializer list>')
             parent[nx][ny]= {x,y};

                           ^
vase.cpp:41:27: note: candidates are:
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from vase.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:158:7: note: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_T1, _T2>&) [with _T1 = int; _T2 = int]
       operator=(const pair& __p)
       ^
/usr/include/c++/4.8/bits/stl_pair.h:158:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::pair<int, int>&'
/usr/include/c++/4.8/bits/stl_pair.h:166:7: note: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_T1, _T2>&&) [with _T1 = int; _T2 = int]
       operator=(pair&& __p)
       ^
/usr/include/c++/4.8/bits/stl_pair.h:166:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::pair<int, int>&&'
/usr/include/c++/4.8/bits/stl_pair.h:177:2: note: template<class _U1, class _U2> std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U1 = _U1; _U2 = _U2; _T1 = int; _T2 = int]
  operator=(const pair<_U1, _U2>& __p)
  ^
/usr/include/c++/4.8/bits/stl_pair.h:177:2: note:   template argument deduction/substitution failed:
vase.cpp:41:27: note:   couldn't deduce template parameter '_U1'
             parent[nx][ny]= {x,y};

                           ^
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from vase.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:186:2: note: template<class _U1, class _U2> std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U1 = _U1; _U2 = _U2; _T1 = int; _T2 = int]
  operator=(pair<_U1, _U2>&& __p)
  ^
/usr/include/c++/4.8/bits/stl_pair.h:186:2: note:   template argument deduction/substitution failed:
vase.cpp:41:27: note:   couldn't deduce template parameter '_U1'
             parent[nx][ny]= {x,y};

                           ^
vase.cpp:50:27: error: no match for 'operator=' (operand types are 'std::pair<int, int>' and '<brace-enclosed initializer list>')
             parent[nx][ny]= {x,y};

                           ^
vase.cpp:50:27: note: candidates are:
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from vase.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:158:7: note: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_T1, _T2>&) [with _T1 = int; _T2 = int]
       operator=(const pair& __p)
       ^
/usr/include/c++/4.8/bits/stl_pair.h:158:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::pair<int, int>&'
/usr/include/c++/4.8/bits/stl_pair.h:166:7: note: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_T1, _T2>&&) [with _T1 = int; _T2 = int]
       operator=(pair&& __p)
       ^
/usr/include/c++/4.8/bits/stl_pair.h:166:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::pair<int, int>&&'
/usr/include/c++/4.8/bits/stl_pair.h:177:2: note: template<class _U1, class _U2> std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U1 = _U1; _U2 = _U2; _T1 = int; _T2 = int]
  operator=(const pair<_U1, _U2>& __p)
  ^
/usr/include/c++/4.8/bits/stl_pair.h:177:2: note:   template argument deduction/substitution failed:
vase.cpp:50:27: note:   couldn't deduce template parameter '_U1'
             parent[nx][ny]= {x,y};

                           ^
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from vase.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:186:2: note: template<class _U1, class _U2> std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U1 = _U1; _U2 = _U2; _T1 = int; _T2 = int]
  operator=(pair<_U1, _U2>&& __p)
  ^
/usr/include/c++/4.8/bits/stl_pair.h:186:2: note:   template argument deduction/substitution failed:
vase.cpp:50:27: note:   couldn't deduce template parameter '_U1'
             parent[nx][ny]= {x,y};

                           ^
vase.cpp:59:27: error: no match for 'operator=' (operand types are 'std::pair<int, int>' and '<brace-enclosed initializer list>')
             parent[nx][ny]= {x,y};

                           ^
vase.cpp:59:27: note: candidates are:
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from vase.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:158:7: note: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_T1, _T2>&) [with _T1 = int; _T2 = int]
       operator=(const pair& __p)
       ^
/usr/include/c++/4.8/bits/stl_pair.h:158:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::pair<int, int>&'
/usr/include/c++/4.8/bits/stl_pair.h:166:7: note: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_T1, _T2>&&) [with _T1 = int; _T2 = int]
       operator=(pair&& __p)
       ^
/usr/include/c++/4.8/bits/stl_pair.h:166:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::pair<int, int>&&'
/usr/include/c++/4.8/bits/stl_pair.h:177:2: note: template<class _U1, class _U2> std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U1 = _U1; _U2 = _U2; _T1 = int; _T2 = int]
  operator=(const pair<_U1, _U2>& __p)
  ^
/usr/include/c++/4.8/bits/stl_pair.h:177:2: note:   template argument deduction/substitution failed:
vase.cpp:59:27: note:   couldn't deduce template parameter '_U1'
             parent[nx][ny]= {x,y};

                           ^
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from vase.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:186:2: note: template<class _U1, class _U2> std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U1 = _U1; _U2 = _U2; _T1 = int; _T2 = int]
  operator=(pair<_U1, _U2>&& __p)
  ^
/usr/include/c++/4.8/bits/stl_pair.h:186:2: note:   template argument deduction/substitution failed:
vase.cpp:59:27: note:   couldn't deduce template parameter '_U1'
             parent[nx][ny]= {x,y};

                           ^
vase.cpp:70:28: error: no match for 'operator=' (operand types are 'std::pair<int, int>' and '<brace-enclosed initializer list>')
             parent[nx][ny] = {x, y};

                            ^
vase.cpp:70:28: note: candidates are:
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from vase.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:158:7: note: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_T1, _T2>&) [with _T1 = int; _T2 = int]
       operator=(const pair& __p)
       ^
/usr/include/c++/4.8/bits/stl_pair.h:158:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::pair<int, int>&'
/usr/include/c++/4.8/bits/stl_pair.h:166:7: note: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_T1, _T2>&&) [with _T1 = int; _T2 = int]
       operator=(pair&& __p)
       ^
/usr/include/c++/4.8/bits/stl_pair.h:166:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::pair<int, int>&&'
/usr/include/c++/4.8/bits/stl_pair.h:177:2: note: template<class _U1, class _U2> std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U1 = _U1; _U2 = _U2; _T1 = int; _T2 = int]
  operator=(const pair<_U1, _U2>& __p)
  ^
/usr/include/c++/4.8/bits/stl_pair.h:177:2: note:   template argument deduction/substitution failed:
vase.cpp:70:28: note:   couldn't deduce template parameter '_U1'
             parent[nx][ny] = {x, y};

                            ^
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from vase.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:186:2: note: template<class _U1, class _U2> std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U1 = _U1; _U2 = _U2; _T1 = int; _T2 = int]
  operator=(pair<_U1, _U2>&& __p)
  ^
/usr/include/c++/4.8/bits/stl_pair.h:186:2: note:   template argument deduction/substitution failed:
vase.cpp:70:28: note:   couldn't deduce template parameter '_U1'
             parent[nx][ny] = {x, y};

                            ^
vase.cpp:81:28: error: no match for 'operator=' (operand types are 'std::pair<int, int>' and '<brace-enclosed initializer list>')
             parent[nx][ny] = {x, y};

                            ^
vase.cpp:81:28: note: candidates are:
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from vase.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:158:7: note: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_T1, _T2>&) [with _T1 = int; _T2 = int]
       operator=(const pair& __p)
       ^
/usr/include/c++/4.8/bits/stl_pair.h:158:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::pair<int, int>&'
/usr/include/c++/4.8/bits/stl_pair.h:166:7: note: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_T1, _T2>&&) [with _T1 = int; _T2 = int]
       operator=(pair&& __p)
       ^
/usr/include/c++/4.8/bits/stl_pair.h:166:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::pair<int, int>&&'
/usr/include/c++/4.8/bits/stl_pair.h:177:2: note: template<class _U1, class _U2> std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U1 = _U1; _U2 = _U2; _T1 = int; _T2 = int]
  operator=(const pair<_U1, _U2>& __p)
  ^
/usr/include/c++/4.8/bits/stl_pair.h:177:2: note:   template argument deduction/substitution failed:
vase.cpp:81:28: note:   couldn't deduce template parameter '_U1'
             parent[nx][ny] = {x, y};

                            ^
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/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from vase.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:186:2: note: template<class _U1, class _U2> std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U1 = _U1; _U2 = _U2; _T1 = int; _T2 = int]
  operator=(pair<_U1, _U2>&& __p)
  ^
/usr/include/c++/4.8/bits/stl_pair.h:186:2: note:   template argument deduction/substitution failed:
vase.cpp:81:28: note:   couldn't deduce template parameter '_U1'
             parent[nx][ny] = {x, y};

                            ^

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

Du-te sus!