Detalii evaluare #64077601

Rezumat problemă

Determinați toate permutările circulare spre stânga ale unui vector dat.

Detalii

Problema PermCirc Operații I/O tastatură/ecran
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #64077601 Utilizator pop denis (popdenis554)
Fișier permcirc.cpp Dimensiune 372 B
Data încărcării 15 Aprilie 2026, 20:46 Scor/rezultat Eroare de compilare

Evaluare

Mesaj compilare

permcirc.cpp: In function ‘int main()’:
permcirc.cpp:13:19: error: no match for ‘operator<’ (operand types are ‘std::basic_ostream<char>’ and ‘const char [2]’)
   13 |         cout<<v[i]<" ";
      |         ~~~~~~~~~~^~~~
      |             |      |
      |             |      const char [2]
      |             std::basic_ostream<char>
In file included from /usr/include/c++/13/string:48,
                 from /usr/include/c++/13/bits/locale_classes.h:40,
                 from /usr/include/c++/13/bits/ios_base.h:41,
                 from /usr/include/c++/13/ios:44,
                 from /usr/include/c++/13/ostream:40,
                 from /usr/include/c++/13/iostream:41,
                 from permcirc.cpp:1:
/usr/include/c++/13/bits/stl_iterator.h:455:5: note: candidate: ‘template<class _Iterator> bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)’
  455 |     operator<(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:455:5: note:   template argument deduction/substitution failed:
permcirc.cpp:13:20: note:   ‘std::basic_ostream<char>’ is not derived from ‘const std::reverse_iterator<_Iterator>’
   13 |         cout<<v[i]<" ";
      |                    ^~~
/usr/include/c++/13/bits/stl_iterator.h:500:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)’
  500 |     operator<(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:500:5: note:   template argument deduction/substitution failed:
permcirc.cpp:13:20: note:   ‘std::basic_ostream<char>’ is not derived from ‘const std::reverse_iterator<_Iterator>’
   13 |         cout<<v[i]<" ";
      |                    ^~~
/usr/include/c++/13/bits/stl_iterator.h:1705:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)’
 1705 |     operator<(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1705:5: note:   template argument deduction/substitution failed:
permcirc.cpp:13:20: note:   ‘std::basic_ostream<char>’ is not derived from ‘const std::move_iterator<_IteratorL>’
   13 |         cout<<v[i]<" ";
      |                    ^~~
/usr/include/c++/13/bits/stl_iterator.h:1770:5: note: candidate: ‘template<class _Iterator> bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)’
 1770 |     operator<(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1770:5: note:   template argument deduction/substitution failed:
permcirc.cpp:13:20: note:   ‘std::basic_ostream<char>’ is not derived from ‘const std::move_iterator<_IteratorL>’
   13 |         cout<<v[i]<" ";
      |                    ^~~
In file included from /usr/include/c++/13/bits/stl_algobase.h:64,
                 from /usr/include/c++/13/string:51:
/usr/include/c++/13/bits/stl_pair.h:835:5: note: candidate: ‘template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)’
  835 |     operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_pair.h:835:5: note:   template argument deduction/substitution failed:
permcirc.cpp:13:20: note:   ‘std::basic_ostream<char>’ is not derived from ‘const std::pair<_T1, _T2>’
   13 |         cout<<v[i]<" ";
      |                    ^~~
In file included from /usr/include/c++/13/string:54:
/usr/include/c++/13/bits/basic_string.h:3829:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’
 3829 |     operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3829:5: note:   template argument deduction/substitution failed:
permcirc.cpp:13:20: note:   ‘std::basic_ostream<char>’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
   13 |         cout<<v[i]<" ";
      |                    ^~~
/usr/include/c++/13/bits/basic_string.h:3843:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)’
 3843 |     operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3843:5: note:   template argument deduction/substitution failed:
permcirc.cpp:13:20: note:   ‘std::basic_ostream<char>’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
   13 |         cout<<v[i]<" ";
      |                    ^~~
/usr/include/c++/13/bits/basic_string.h:3856:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’
 3856 |     operator<(const _CharT* __lhs,
      |     ^~~~~~~~
/usr/include/c++/13/bits/basic_string.h:3856:5: note:   template argument deduction/substitution failed:
permcirc.cpp:13:20: note:   mismatched types ‘const _CharT*’ and ‘std::basic_ostream<char>’
   13 |         cout<<v[i]<" ";
      |                    ^~~
In file included from /usr/include/c++/13/bits/ios_base.h:46:
/usr/include/c++/13/system_error:324:3: note: candidate: ‘bool std::operator<(const error_code&, const error_code&)’
  324 |   operator<(const error_code& __lhs, const error_code& __rhs) noexcept
      |   ^~~~~~~~
/usr/include/c++/13/system_error:324:31: note:   no known conversion for argument 1 from ‘std::basic_ostream<char>’ to ‘const std::error_code&’
  324 |   operator<(const error_code& __lhs, const error_code& __rhs) noexcept
      |             ~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/13/system_error:507:3: note: candidate: ‘bool std::operator<(const error_condition&, const error_condition&)’
  507 |   operator<(const error_condition& __lhs,
      |   ^~~~~~~~
/usr/include/c++/13/system_error:507:36: note:   no known conversion for argument 1 from ‘std::basic_ostream<char>’ to ‘const std::error_condition&’
  507 |   operator<(const error_condition& __lhs,
      |             ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
permcirc.cpp:12:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
   12 |     for(i=1;i<=n;i++)
      |     ^~~
permcirc.cpp:14:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
   14 |         cout<<'\n';
      |         ^~~~
permcirc.cpp:16:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
   16 |         for(i=1;i<=n-1;i++)
      |         ^~~
permcirc.cpp:18:11: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
   18 |           v[n]=x;
      |           ^
permcirc.cpp: At global scope:
permcirc.cpp:22:5: error: expected unqualified-id before ‘return’
   22 |     return 0;
      |     ^~~~~~
permcirc.cpp:23:1: error: expected declaration before ‘}’ token
   23 | }
      | ^

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 PermCirc 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!