Detalii evaluare #44399424

Rezumat problemă

Se dă o permutare P a mulțimii {1,2, … ,N}. Se mai dau Q întrebări specificate prin câte un număr D.

Dacă D este pozitiv trebuie să determinăm a D-a permutare care succede lexicografic P iar dacă D este negativ, a D-a permutare care precede lexicografic P.

Detalii

Problema permutari3 Operații I/O permutari3.in/permutari3.out
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #44399424 Utilizator Stefan Tiberiu (tiberiustefan)
Fișier permutari3.cpp Dimensiune 1.71 KB
Data încărcării 13 August 2023, 13:41 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

permutari3.cpp:20:1: error: stray '\310' in program
 Ești sigur că dorești să vezi soluția?

 ^
permutari3.cpp:20:1: error: stray '\231' in program
permutari3.cpp:20:1: error: stray '\304' in program
permutari3.cpp:20:1: error: stray '\203' in program
permutari3.cpp:20:1: error: stray '\310' in program
permutari3.cpp:20:1: error: stray '\231' in program
permutari3.cpp:20:1: error: stray '\304' in program
permutari3.cpp:20:1: error: stray '\203' in program
permutari3.cpp:20:1: error: stray '\310' in program
permutari3.cpp:20:1: error: stray '\233' in program
permutari3.cpp: In function 'int main()':
permutari3.cpp:13:52: error: wrong number of template arguments (1, should be 2)
  std::vector<Pair<short unsigned index, const char*>> data;

                                                    ^
permutari3.cpp:7:8: error: provided for 'template<class K, class V> struct Pair'
 struct Pair{

        ^
permutari3.cpp:13:55: error: template argument 1 is invalid
  std::vector<Pair<short unsigned index, const char*>> data;

                                                       ^
permutari3.cpp:13:55: error: template argument 2 is invalid
permutari3.cpp:14:2: error: 'data' was not declared in this scope
  data.reserve(MAX_SIZE);

  ^
permutari3.cpp:15:44: error: expected ')' before ';' token
  printf("%s", "Acesta este un cod exemplu.";

                                            ^
permutari3.cpp: At global scope:
permutari3.cpp:20:1: error: 'E' does not name a type
 Ești sigur că dorești să vezi soluția?

 ^
In file included from /usr/include/c++/4.8/fstream:936:0,
                 from permutari3.cpp:25:
/usr/include/c++/4.8/bits/fstream.tcc: In member function 'virtual std::basic_filebuf<_CharT, _Traits>::int_type std::basic_filebuf<_CharT, _Traits>::underflow()':
/usr/include/c++/4.8/bits/fstream.tcc:232:4: error: incomplete type 'std::codecvt_base' used in nested name specifier
    codecvt_base::result __r = codecvt_base::ok;
    ^
/usr/include/c++/4.8/bits/fstream.tcc:232:25: error: expected ';' before '__r'
    codecvt_base::result __r = codecvt_base::ok;
                         ^
/usr/include/c++/4.8/bits/fstream.tcc:304:7: error: '__r' was not declared in this scope
       __r = _M_codecvt->in(_M_state_cur, _M_ext_next,
       ^
/usr/include/c++/4.8/bits/fstream.tcc:308:9: error: '__r' was not declared in this scope
     if (__r == codecvt_base::noconv)
         ^
/usr/include/c++/4.8/bits/fstream.tcc:308:16: error: incomplete type 'std::codecvt_base' used in nested name specifier
     if (__r == codecvt_base::noconv)
                ^
/usr/include/c++/4.8/bits/fstream.tcc:323:9: error: '__r' was not declared in this scope
     if (__r == codecvt_base::error)
         ^
/usr/include/c++/4.8/bits/fstream.tcc:323:16: error: incomplete type 'std::codecvt_base' used in nested name specifier
     if (__r == codecvt_base::error)
                ^
/usr/include/c++/4.8/bits/fstream.tcc:346:12: error: '__r' was not declared in this scope
        if (__r == codecvt_base::partial)
            ^
/usr/include/c++/4.8/bits/fstream.tcc:346:19: error: incomplete type 'std::codecvt_base' used in nested name specifier
        if (__r == codecvt_base::partial)
                   ^
/usr/include/c++/4.8/bits/fstream.tcc:350:13: error: '__r' was not declared in this scope
    else if (__r == codecvt_base::error)
             ^
/usr/include/c++/4.8/bits/fstream.tcc:350:20: error: incomplete type 'std::codecvt_base' used in nested name specifier
    else if (__r == codecvt_base::error)
                    ^
/usr/include/c++/4.8/bits/fstream.tcc: In member function 'bool std::basic_filebuf<_CharT, _Traits>::_M_convert_to_external(_CharT*, std::streamsize)':
/usr/include/c++/4.8/bits/fstream.tcc:505:4: error: incomplete type 'std::codecvt_base' used in nested name specifier
    codecvt_base::result __r;
    ^
/usr/include/c++/4.8/bits/fstream.tcc:505:25: error: expected ';' before '__r'
    codecvt_base::result __r;
                         ^
/usr/include/c++/4.8/bits/fstream.tcc:506:4: error: '__r' was not declared in this scope
    __r = _M_codecvt->out(_M_state_cur, __ibuf, __ibuf + __ilen,
    ^
/usr/include/c++/4.8/bits/fstream.tcc:509:15: error: incomplete type 'std::codecvt_base' used in nested name specifier
    if (__r == codecvt_base::ok || __r == codecvt_base::partial)
               ^
/usr/include/c++/4.8/bits/fstream.tcc:509:42: error: incomplete type 'std::codecvt_base' used in nested name specifier
    if (__r == codecvt_base::ok || __r == codecvt_base::partial)
                                          ^
/usr/include/c++/4.8/bits/fstream.tcc:511:20: error: incomplete type 'std::codecvt_base' used in nested name specifier
    else if (__r == codecvt_base::noconv)
                    ^
/usr/include/c++/4.8/bits/fstream.tcc:525:15: error: incomplete type 'std::codecvt_base' used in nested name specifier
    if (__r == codecvt_base::partial && __elen == __plen)
               ^
/usr/include/c++/4.8/bits/fstream.tcc:532:19: error: incomplete type 'std::codecvt_base' used in nested name specifier
        if (__r != codecvt_base::error)
                   ^
/usr/include/c++/4.8/bits/fstream.tcc: In member function 'bool std::basic_filebuf<_CharT, _Traits>::_M_terminate_output()':
/usr/include/c++/4.8/bits/fstream.tcc:852:4: error: incomplete type 'std::codecvt_base' used in nested name specifier
    codecvt_base::result __r;
    ^
/usr/include/c++/4.8/bits/fstream.tcc:852:25: error: expected ';' before '__r'
    codecvt_base::result __r;
                         ^
/usr/include/c++/4.8/bits/fstream.tcc:858:8: error: '__r' was not declared in this scope
        __r = _M_codecvt->unshift(_M_state_cur, __buf,
        ^
/usr/include/c++/4.8/bits/fstream.tcc:860:19: error: incomplete type 'std::codecvt_base' used in nested name specifier
        if (__r == codecvt_base::error)
                   ^
/usr/include/c++/4.8/bits/fstream.tcc:862:24: error: incomplete type 'std::codecvt_base' used in nested name specifier
        else if (__r == codecvt_base::ok ||
                        ^
/usr/include/c++/4.8/bits/fstream.tcc:863:17: error: incomplete type 'std::codecvt_base' used in nested name specifier
          __r == codecvt_base::partial)
                 ^
/usr/include/c++/4.8/bits/fstream.tcc:874:11: error: '__r' was not declared in this scope
    while (__r == codecvt_base::partial && __ilen > 0 && __testvalid);
           ^
/usr/include/c++/4.8/bits/fstream.tcc:874:18: error: incomplete type 'std::codecvt_base' used in nested name specifier
    while (__r == codecvt_base::partial && __ilen > 0 && __testvalid);
                  ^
permutari3.cpp: In function 'int main()':
permutari3.cpp:34:5: error: redefinition of 'int main()'
 int main() {

     ^
permutari3.cpp:12:5: error: 'int main()' previously defined here
 int main() {

     ^
permutari3.cpp:54:8: warning: statement has no effect [-Wunused-value]
     poz;

        ^

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