Detalii evaluare #53719845

Rezumat problemă

Se dă o listă de N numere naturale, indexată de la 1 la N, și Q query-uri de forma op poz, unde op = 1, 2 este tipul operației.

Cele 2 operații sunt:

  • op = 1: se șterge din listă elementul aflat pe poziția poz
  • op = 2: se afișează elementul din listă aflat pe poziția poz

Detalii

Problema Big Data Operații I/O bigdata.in/bigdata.out
Limita timp 1 secunde Limita memorie Total: 4 MB / Stivă 4 MB
Id soluție #53719845 Utilizator BURLACU ANDREI (andreiburlacuvalentin)
Fișier big_data.cpp Dimensiune 760 B
Data încărcării 09 Noiembrie 2024, 16:29 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

big_data.cpp: In function 'int main()':
big_data.cpp:12:17: error: 'string' was not declared in this scope
     std::vector<string> lista(N);

                 ^
big_data.cpp:12:17: note: suggested alternative:
In file included from /usr/include/c++/4.8/iosfwd:39:0,
                 from /usr/include/c++/4.8/ios:38,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from big_data.cpp:1:
/usr/include/c++/4.8/bits/stringfwd.h:62:33: note:   'std::string'
   typedef basic_string<char>    string;   
                                 ^
big_data.cpp:12:23: error: template argument 1 is invalid
     std::vector<string> lista(N);

                       ^
big_data.cpp:12:23: error: template argument 2 is invalid
big_data.cpp:12:30: error: invalid type in declaration before '(' token
     std::vector<string> lista(N);

                              ^
big_data.cpp:14:23: error: invalid types 'int[int]' for array subscript
         fin >> lista[i];

                       ^
big_data.cpp:17:17: error: 'sring' was not declared in this scope
     std::vector<sring> rezultate; 

                 ^
big_data.cpp:17:22: error: template argument 1 is invalid
     std::vector<sring> rezultate; 

                      ^
big_data.cpp:17:22: error: template argument 2 is invalid
big_data.cpp:17:33: error: invalid type in declaration before ';' token
     std::vector<sring> rezultate; 

                                 ^
big_data.cpp:25:19: error: request for member 'erase' in 'lista', which is of non-class type 'int'
             lista.erase(lista.begin() + (poz - 1));

                   ^
big_data.cpp:25:31: error: request for member 'begin' in 'lista', which is of non-class type 'int'
             lista.erase(lista.begin() + (poz - 1));

                               ^
big_data.cpp:28:23: error: request for member 'push_back' in 'rezultate', which is of non-class type 'int'
             rezultate.push_back(lista[poz - 1]);

                       ^
big_data.cpp:28:46: error: invalid types 'int[int]' for array subscript
             rezultate.push_back(lista[poz - 1]);

                                              ^
big_data.cpp:33:21: error: no matching function for call to 'begin(int&)'
     for (auto rez : rezultate) {

                     ^
big_data.cpp:33:21: note: candidates are:
In file included from /usr/include/c++/4.8/bits/basic_string.h:42:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from big_data.cpp:1:
/usr/include/c++/4.8/initializer_list:89:5: note: template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)
     begin(initializer_list<_Tp> __ils) noexcept
     ^
/usr/include/c++/4.8/initializer_list:89:5: note:   template argument deduction/substitution failed:
big_data.cpp:33:21: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
     for (auto rez : rezultate) {

                     ^
In file included from /usr/include/c++/4.8/string:51:0,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from big_data.cpp:1:
/usr/include/c++/4.8/bits/range_access.h:87:5: note: template<class _Tp, unsigned int _Nm> _Tp* std::begin(_Tp (&)[_Nm])
     begin(_Tp (&__arr)[_Nm])
     ^
/usr/include/c++/4.8/bits/range_access.h:87:5: note:   template argument deduction/substitution failed:
big_data.cpp:33:21: note:   mismatched types '_Tp [_Nm]' and 'int'
     for (auto rez : rezultate) {

                     ^
In file included from /usr/include/c++/4.8/string:51:0,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from big_data.cpp:1:
/usr/include/c++/4.8/bits/range_access.h:58:5: note: template<class _Container> decltype (__cont.begin()) std::begin(const _Container&)
     begin(const _Container& __cont) -> decltype(__cont.begin())
     ^
/usr/include/c++/4.8/bits/range_access.h:58:5: note:   template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.begin()) std::begin(const _Container&) [with _Container = int]':
big_data.cpp:33:21:   required from here
/usr/include/c++/4.8/bits/range_access.h:58:5: error: request for member 'begin' in '__cont', which is of non-class type 'const int'
/usr/include/c++/4.8/bits/range_access.h:48:5: note: template<class _Container> decltype (__cont.begin()) std::begin(_Container&)
     begin(_Container& __cont) -> decltype(__cont.begin())
     ^
/usr/include/c++/4.8/bits/range_access.h:48:5: note:   template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.begin()) std::begin(_Container&) [with _Container = int]':
big_data.cpp:33:21:   required from here
/usr/include/c++/4.8/bits/range_access.h:48:5: error: request for member 'begin' in '__cont', which is of non-class type 'int'
big_data.cpp:33:21: error: no matching function for call to 'end(int&)'
     for (auto rez : rezultate) {

                     ^
big_data.cpp:33:21: note: candidates are:
In file included from /usr/include/c++/4.8/bits/basic_string.h:42:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from big_data.cpp:1:
/usr/include/c++/4.8/initializer_list:99:5: note: template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)
     end(initializer_list<_Tp> __ils) noexcept
     ^
/usr/include/c++/4.8/initializer_list:99:5: note:   template argument deduction/substitution failed:
big_data.cpp:33:21: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
     for (auto rez : rezultate) {

                     ^
In file included from /usr/include/c++/4.8/string:51:0,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from big_data.cpp:1:
/usr/include/c++/4.8/bits/range_access.h:97:5: note: template<class _Tp, unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])
     end(_Tp (&__arr)[_Nm])
     ^
/usr/include/c++/4.8/bits/range_access.h:97:5: note:   template argument deduction/substitution failed:
big_data.cpp:33:21: note:   mismatched types '_Tp [_Nm]' and 'int'
     for (auto rez : rezultate) {

                     ^
In file included from /usr/include/c++/4.8/string:51:0,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from big_data.cpp:1:
/usr/include/c++/4.8/bits/range_access.h:78:5: note: template<class _Container> decltype (__cont.end()) std::end(const _Container&)
     end(const _Container& __cont) -> decltype(__cont.end())
     ^
/usr/include/c++/4.8/bits/range_access.h:78:5: note:   template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.end()) std::end(const _Container&) [with _Container = int]':
big_data.cpp:33:21:   required from here
/usr/include/c++/4.8/bits/range_access.h:78:5: error: request for member 'end' in '__cont', which is of non-class type 'const int'
/usr/include/c++/4.8/bits/range_access.h:68:5: note: template<class _Container> decltype (__cont.end()) std::end(_Container&)
     end(_Container& __cont) -> decltype(__cont.end())
     ^
/usr/include/c++/4.8/bits/range_access.h:68:5: note:   template argument deduction/substitution failed:
/usr/include/c++/4.8/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.end()) std::end(_Container&) [with _Container = int]':
big_data.cpp:33:21:   required from here
/usr/include/c++/4.8/bits/range_access.h:68:5: error: request for member 'end' in '__cont', which is of non-class type 'int'

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 Big Data 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ă.