#2191
lant2
Ion este un lingvist pasionat. Recent el a descoperit un text scris într-o limbă necunoscută. Textul este scris pe mai multe linii şi este format din cuvinte scrise cu litere mici din alfabetul latin, separate prin spaţii sau/şi semne de punctuaţie (,:;.!?-
). Ion a fost frapat că există multe similitudini între cuvintele din text. Fiind foarte riguros, Ion definește similitudinea a două cuvinte după cum urmează. Fie c1
şi c2
două cuvinte. Cuvântul c1
poate fi obţinut din cuvântul c2
printr-o succesiune de operaţii elementare. Operaţiile elementare ce pot fi folosite sunt:
move(c1, c2)
– Mută primul caracter din c1
la sfârşitul cuvântului c2
(de exemplu, dacă c1="alba"
şi c2="neagra"
, după efectuarea operaţiei move(c1, c2)
, c1
va fi "lba"
, iar c2
va fi "neagraa"
)insert(c1, x)
– Inserează caracterul x
la începutul lui c1
(de exemplu, dacă c1="alba"
şi x='b'
, după executarea operaţiei insert(c1,x)
, c1
va fi "balba"
)delete(c1)
– Şterge primul caracter din c1
(de exemplu, dacă c1="alba"
, după executarea operaţiei delete(c1)
, c1
va fi "lba"
)Definim similitudinea dintre c1
şi c2
ca fiind numărul minim de operații insert
şi delete
ce trebuie să fie executate pentru a transforma cuvântul c1
în cuvântul c2
(operațiile move
nu se numără).
Fie c0
primul cuvânt din text. Începând cu c0
putem construi lanțuri de k
-similitudine.
Un lanţ de k
-similitudine este o succesiune de cuvinte distincte din text cu următoarele proprietăți:
x
apare în lanţ înaintea cuvântului y
, atunci prima apariţie a lui x
în text precedă prima apariţie a lui y
în text;x
şi y
sunt cuvinte consecutive în lanţ (în ordinea x y
), atunci similitudinea dintre x
şi y
este mai mică sau egală decât k
;Scrieţi un program care să determine numărul de lanţuri de k
-similitudine care încep cu c0
.
Olimpiada județeană de informatică, 2005
Problema | lant2 | Operații I/O |
lant2.in /lant2.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #36931555 | Utilizator | |
Fișier | lant2.cpp | Dimensiune | 2.19 KB |
Data încărcării | 01 Iunie 2022, 17:47 | Scor / rezultat | Eroare de compilare |
lant2.cpp:1:1: error: 'include' does not name a type include <fstream> ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/type_traits:285:31: error: 'std::size_t' has not been declared template<typename _Tp, std::size_t _Size> ^ /usr/include/c++/4.8/type_traits:419:34: error: 'nullptr_t' is not a member of 'std' struct __is_nullptr_t_helper<std::nullptr_t> ^ /usr/include/c++/4.8/type_traits:419:34: error: 'nullptr_t' is not a member of 'std' /usr/include/c++/4.8/type_traits:419:48: error: template argument 1 is invalid struct __is_nullptr_t_helper<std::nullptr_t> ^ /usr/include/c++/4.8/type_traits:1239:32: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, __alignof__(_Tp)> { }; ^ /usr/include/c++/4.8/type_traits:1239:32: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/type_traits:1239:32: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, __alignof__(_Tp)> { }; ^ /usr/include/c++/4.8/type_traits:1239:32: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/type_traits:1239:61: error: template argument 1 is invalid : public integral_constant<std::size_t, __alignof__(_Tp)> { }; ^ /usr/include/c++/4.8/type_traits:1239:61: note: invalid template non-type parameter /usr/include/c++/4.8/type_traits:1244:32: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, 0> { }; ^ /usr/include/c++/4.8/type_traits:1244:32: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/type_traits:1244:32: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, 0> { }; ^ /usr/include/c++/4.8/type_traits:1244:32: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/type_traits:1244:46: error: template argument 1 is invalid : public integral_constant<std::size_t, 0> { }; ^ /usr/include/c++/4.8/type_traits:1244:46: note: invalid template non-type parameter /usr/include/c++/4.8/type_traits:1246:31: error: 'std::size_t' has not been declared template<typename _Tp, std::size_t _Size> ^ /usr/include/c++/4.8/type_traits:1248:32: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; ^ /usr/include/c++/4.8/type_traits:1248:32: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/type_traits:1248:32: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; ^ /usr/include/c++/4.8/type_traits:1248:32: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/type_traits:1248:65: error: template argument 1 is invalid : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; ^ /usr/include/c++/4.8/type_traits:1248:65: note: invalid template non-type parameter /usr/include/c++/4.8/type_traits:1252:32: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; ^ /usr/include/c++/4.8/type_traits:1252:32: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/type_traits:1252:32: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; ^ /usr/include/c++/4.8/type_traits:1252:32: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/type_traits:1252:65: error: template argument 1 is invalid : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; ^ /usr/include/c++/4.8/type_traits:1252:65: note: invalid template non-type parameter /usr/include/c++/4.8/type_traits:1257:32: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, 0> { }; ^ /usr/include/c++/4.8/type_traits:1257:32: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/type_traits:1257:32: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, 0> { }; ^ /usr/include/c++/4.8/type_traits:1257:32: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/type_traits:1257:46: error: template argument 1 is invalid : public integral_constant<std::size_t, 0> { }; ^ /usr/include/c++/4.8/type_traits:1257:46: note: invalid template non-type parameter /usr/include/c++/4.8/type_traits:1259:47: error: 'std::size_t' has not been declared template<typename _Tp, unsigned _Uint, std::size_t _Size> ^ /usr/include/c++/4.8/type_traits:1261:32: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, ^ /usr/include/c++/4.8/type_traits:1261:32: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/type_traits:1261:32: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, ^ /usr/include/c++/4.8/type_traits:1261:32: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/type_traits:1263:28: error: template argument 1 is invalid _Uint - 1>::value> ^ /usr/include/c++/4.8/type_traits:1263:28: note: invalid template non-type parameter /usr/include/c++/4.8/type_traits:1268:32: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, ^ /usr/include/c++/4.8/type_traits:1268:32: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/type_traits:1268:32: error: 'size_t' is not a member of 'std' : public integral_constant<std::size_t, ^ /usr/include/c++/4.8/type_traits:1268:32: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/bits/move.h:57:0, from /usr/include/c++/4.8/bits/stl_pair.h:59, from /usr/include/c++/4.8/bits/stl_algobase.h:64, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/type_traits:1270:31: error: template argument 1 is invalid _Uint - 1>::value> ^ /usr/include/c++/4.8/type_traits:1270:31: note: invalid template non-type parameter /usr/include/c++/4.8/type_traits:1627:31: error: 'std::size_t' has not been declared template<typename _Tp, std::size_t _Size> ^ /usr/include/c++/4.8/type_traits:1640:31: error: 'std::size_t' has not been declared template<typename _Tp, std::size_t _Size> ^ /usr/include/c++/4.8/type_traits:1671:17: error: 'std::size_t' has not been declared template<std::size_t _Len> ^ /usr/include/c++/4.8/type_traits:1691:17: error: 'std::size_t' has not been declared template<std::size_t _Len, std::size_t _Align = ^ /usr/include/c++/4.8/type_traits:1691:35: error: 'std::size_t' has not been declared template<std::size_t _Len, std::size_t _Align = ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/bits/stl_pair.h:85:17: error: 'std::size_t' has not been declared template<std::size_t...> ^ /usr/include/c++/4.8/bits/stl_pair.h:204:41: error: 'std::size_t' has not been declared template<typename... _Args1, std::size_t... _Indexes1, ^ /usr/include/c++/4.8/bits/stl_pair.h:205:41: error: 'std::size_t' has not been declared typename... _Args2, std::size_t... _Indexes2> ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:65:0, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/bits/stl_iterator_base_types.h:116:67: error: expected type-specifier before 'ptrdiff_t' template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t, ^ /usr/include/c++/4.8/bits/stl_iterator_base_types.h:116:67: error: expected '>' before 'ptrdiff_t' /usr/include/c++/4.8/bits/stl_iterator_base_types.h:127:15: error: '_Pointer' does not name a type typedef _Pointer pointer; ^ /usr/include/c++/4.8/bits/stl_iterator_base_types.h:129:15: error: '_Reference' does not name a type typedef _Reference reference; ^ /usr/include/c++/4.8/bits/stl_iterator_base_types.h:179:15: error: 'ptrdiff_t' does not name a type typedef ptrdiff_t difference_type; ^ /usr/include/c++/4.8/bits/stl_iterator_base_types.h:190:15: error: 'ptrdiff_t' does not name a type typedef ptrdiff_t difference_type; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/bits/stl_iterator.h:101:69: error: wrong number of template arguments (5, should be 3) typename iterator_traits<_Iterator>::reference> ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:65:0, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/bits/stl_iterator_base_types.h:118:12: error: provided for 'template<class _Category, class _Tp, class _Distance> struct std::iterator' struct iterator ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/bits/stl_iterator.h:403:66: error: wrong number of template arguments (5, should be 3) : public iterator<output_iterator_tag, void, void, void, void> ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:65:0, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/bits/stl_iterator_base_types.h:118:12: error: provided for 'template<class _Category, class _Tp, class _Distance> struct std::iterator' struct iterator ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/bits/stl_iterator.h:494:66: error: wrong number of template arguments (5, should be 3) : public iterator<output_iterator_tag, void, void, void, void> ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:65:0, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/bits/stl_iterator_base_types.h:118:12: error: provided for 'template<class _Category, class _Tp, class _Distance> struct std::iterator' struct iterator ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/bits/stl_iterator.h:588:66: error: wrong number of template arguments (5, should be 3) : public iterator<output_iterator_tag, void, void, void, void> ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:65:0, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/bits/stl_iterator_base_types.h:118:12: error: provided for 'template<class _Category, class _Tp, class _Distance> struct std::iterator' struct iterator ^ In file included from /usr/include/c++/4.8/vector:60:0, from lant2.cpp:3: /usr/include/c++/4.8/bits/stl_algobase.h: In static member function 'static _Tp* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(const _Tp*, const _Tp*, _Tp*)': /usr/include/c++/4.8/bits/stl_algobase.h:370:10: error: 'ptrdiff_t' does not name a type const ptrdiff_t _Num = __last - __first; ^ /usr/include/c++/4.8/bits/stl_algobase.h:371:8: error: '_Num' was not declared in this scope if (_Num) ^ /usr/include/c++/4.8/bits/stl_algobase.h:373:22: error: '_Num' was not declared in this scope return __result + _Num; ^ /usr/include/c++/4.8/bits/stl_algobase.h: In static member function 'static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*)': /usr/include/c++/4.8/bits/stl_algobase.h:565:10: error: 'ptrdiff_t' does not name a type const ptrdiff_t _Num = __last - __first; ^ /usr/include/c++/4.8/bits/stl_algobase.h:566:8: error: '_Num' was not declared in this scope if (_Num) ^ /usr/include/c++/4.8/bits/stl_algobase.h:568:22: error: '_Num' was not declared in this scope return __result - _Num; ^ In file included from /usr/include/c++/4.8/exception:152:0, from /usr/include/c++/4.8/new:40, from /usr/include/c++/4.8/ext/new_allocator.h:33, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++allocator.h:33, from /usr/include/c++/4.8/bits/allocator.h:46, from /usr/include/c++/4.8/vector:61, from lant2.cpp:3: /usr/include/c++/4.8/bits/exception_ptr.h: At global scope: /usr/include/c++/4.8/bits/exception_ptr.h:95:30: error: field 'nullptr_t' has incomplete type exception_ptr(nullptr_t) noexcept ^ /usr/include/c++/4.8/bits/exception_ptr.h:95:30: error: expected ';' at end of member declaration /usr/include/c++/4.8/bits/exception_ptr.h:95:32: error: expected unqualified-id before 'noexcept' exception_ptr(nullptr_t) noexcept ^ In file included from /usr/include/c++/4.8/ext/new_allocator.h:33:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++allocator.h:33, from /usr/include/c++/4.8/bits/allocator.h:46, from /usr/include/c++/4.8/vector:61, from lant2.cpp:3: /usr/include/c++/4.8/new:91:31: error: declaration of 'operator new' as non-function void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) ^ /usr/include/c++/4.8/new:91:20: error: 'size_t' is not a member of 'std' void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) ^ /usr/include/c++/4.8/new:91:20: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/ext/new_allocator.h:33:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++allocator.h:33, from /usr/include/c++/4.8/bits/allocator.h:46, from /usr/include/c++/4.8/vector:61, from lant2.cpp:3: /usr/include/c++/4.8/new:93:33: error: declaration of 'operator new []' as non-function void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) ^ /usr/include/c++/4.8/new:93:22: error: 'size_t' is not a member of 'std' void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) ^ /usr/include/c++/4.8/new:93:22: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/ext/new_allocator.h:33:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++allocator.h:33, from /usr/include/c++/4.8/bits/allocator.h:46, from /usr/include/c++/4.8/vector:61, from lant2.cpp:3: /usr/include/c++/4.8/new:99:25: error: declaration of 'operator new' as non-function void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT ^ /usr/include/c++/4.8/new:99:20: error: 'size_t' is not a member of 'std' void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT ^ /usr/include/c++/4.8/new:99:20: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/ext/new_allocator.h:33:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++allocator.h:33, from /usr/include/c++/4.8/bits/allocator.h:46, from /usr/include/c++/4.8/vector:61, from lant2.cpp:3: /usr/include/c++/4.8/new:99:33: error: expected primary-expression before 'const' void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT ^ /usr/include/c++/4.8/new:101:27: error: declaration of 'operator new []' as non-function void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT ^ /usr/include/c++/4.8/new:101:22: error: 'size_t' is not a member of 'std' void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT ^ /usr/include/c++/4.8/new:101:22: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/ext/new_allocator.h:33:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++allocator.h:33, from /usr/include/c++/4.8/bits/allocator.h:46, from /usr/include/c++/4.8/vector:61, from lant2.cpp:3: /usr/include/c++/4.8/new:101:35: error: expected primary-expression before 'const' void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT ^ /usr/include/c++/4.8/new:109:32: error: declaration of 'operator new' as non-function inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT ^ /usr/include/c++/4.8/new:109:27: error: 'size_t' is not a member of 'std' inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT ^ /usr/include/c++/4.8/new:109:27: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/ext/new_allocator.h:33:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++allocator.h:33, from /usr/include/c++/4.8/bits/allocator.h:46, from /usr/include/c++/4.8/vector:61, from lant2.cpp:3: /usr/include/c++/4.8/new:109:40: error: expected primary-expression before 'void' inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT ^ /usr/include/c++/4.8/new:111:34: error: declaration of 'operator new []' as non-function inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT ^ /usr/include/c++/4.8/new:111:29: error: 'size_t' is not a member of 'std' inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT ^ /usr/include/c++/4.8/new:111:29: note: suggested alternative: In file included from /usr/include/string.h:32:0, from /usr/include/c++/4.8/cstring:42, from lant2.cpp:2: /usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note: 'size_t' typedef __SIZE_TYPE__ size_t; ^ In file included from /usr/include/c++/4.8/ext/new_allocator.h:33:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++allocator.h:33, from /usr/include/c++/4.8/bits/allocator.h:46, from /usr/include/c++/4.8/vector:61, from lant2.cpp:3: /usr/include/c++/4.8/new:111:42: error: expected primary-expression before 'void' inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/c++allocator.h:33:0, from /usr/include/c++/4.8/bits/allocator.h:46, from /usr/include/c++/4.8/vector:61, from lant2.cpp:3: /usr/include/c++/4.8/ext/new_allocator.h:44:14: error: 'std::size_t' has not been declared using std::size_t; ^ /usr/include/c++/4.8/ext/new_allocator.h:45:14: error: 'std::ptrdiff_t' has not been declared using std::ptrdiff_t; ^ /usr/include/c++/4.8/ext/new_allocator.h:62:15: error: 'ptrdiff_t' does not name a type typedef ptrdiff_t difference_type; ^ In file included from /usr/include/c++/4.8/vector:61:0, from lant2.cpp:3: /usr/include/c++/4.8/bits/allocator.h:67:15: error: 'ptrdiff_t' does not name a type typedef ptrdiff_t difference_type; ^ /usr/include/c++/4.8/bits/allocator.h:96:15: error: 'ptrdiff_t' does not name a type typedef ptrdiff_t difference_type; ^ In file included from /usr/include/c++/4.8/bits/alloc_traits.h:36:0, from /usr/include/c++/4.8/ext/alloc_traits.h:36, from /usr/include/c++/4.8/bits/stl_construct.h:61, from /usr/include/c++/4.8/vector:62, from lant2.cpp:3: /usr/include/c++/4.8/bits/ptr_traits.h:69:15: error: 'ptrdiff_t' does not name a type typedef ptrdiff_t __type; ^ /usr/include/c++/4.8/bits/ptr_traits.h:162:15: error: 'ptrdiff_t' does not name a type typedef ptrdiff_t difference_type; ^ In file included from /usr/include/c++/4.8/vector:64:0, from lant2.cpp:3: /usr/include/c++/4.8/bits/stl_vector.h:233:15: error: 'ptrdiff_t' does not name a type typedef ptrdiff_t difference_type; ^ In file included from /usr/include/c++/4.8/vector:65:0, from lant2.cpp:3: /usr/include/c++/4.8/bits/stl_bvector.h:137:63: error: template argument 3 is invalid : public std::iterator<std::random_access_iterator_tag, bool> ^ /usr/include/c++/4.8/bits/stl_bvector.h:166:13: error: 'ptrdiff_t' has not been declared _M_incr(ptrdiff_t __i) ^ /usr/include/c++/4.8/bits/stl_bvector.h: In member function 'void std::_Bit_iterator_base::_M_incr(int)': /usr/include/c++/4.8/bits/stl_bvector.h:168:7: error: 'difference_type' was not declared in this scope difference_type __n = __i + _M_offset; ^ /usr/include/c++/4.8/bits/stl_bvector.h:168:23: error: expected ';' before '__n' difference_type __n = __i + _M_offset; ^ /usr/include/c++/4.8/bits/stl_bvector.h:169:15: error: '__n' was not declared in this scope _M_p += __n / int(_S_word_bit); ^ /usr/include/c++/4.8/bits/stl_bvector.h: At global scope: /usr/include/c++/4.8/bits/stl_bvector.h:207:10: error: 'ptrdiff_t' does not name a type inline ptrdiff_t ^ /usr/include/c++/4.8/bits/stl_bvector.h:260:16: error: declaration of 'operator+=' as non-function operator+=(difference_type __i) ^ /usr/include/c++/4.8/bits/stl_bvector.h:260:13: error: expected ';' at end of member declaration operator+=(difference_type __i) ^ /usr/include/c++/4.8/bits/stl_bvector.h:260:32: error: expected ')' before '__i' operator+=(difference_type __i) ^ /usr/include/c++/4.8/bits/stl_bvector.h:267:16: error: declaration of 'operator-=' as non-function operator-=(difference_type __i) ^ /usr/include/c++/4.8/bits/stl_bvector.h:267:13: error: expected ';' at end of member declaration operator-=(difference_type __i) ^ /usr/include/c++/4.8/bits/stl_bvector.h:267:32: error: expected ')' before '__i' operator-=(difference_type __i) ^ /usr/include/c++/4.8/bits/stl_bvector.h:274:15: error: 'difference_type' has not been declared operator+(difference_type __i) const ^ /usr/include/c++/4.8/bits/stl_bvector.h:281:15: error: 'difference_type' has not been declared operator-(difference_type __i) const ^ /usr/include/c++/4.8/bits/stl_bvector.h:288:16: error: 'difference_type' has not been declared operator[](difference_type __i) const ^ /usr/include/c++/4.8/bits/stl_bvector.h: In member function 'std::_Bit_iterator::iterator std::_Bit_iterator::operator+(int) const': /usr/include/c++/4.8/bits/stl_bvector.h:277:20: error: no match for 'operator+=' (operand types are 'std::_Bit_iterator::iterator {aka std::_Bit_iterator}' and 'int') return __tmp += __i; ^ /usr/include/c++/4.8/bits/stl_bvector.h: In member function 'std::_Bit_iterator::iterator std::_Bit_iterator::operator-(int) const': /usr/include/c++/4.8/bits/stl_bvector.h:284:20: error: no match for 'operator-=' (operand types are 'std::_Bit_iterator::iterator {aka std::_Bit_iterator}' and 'int') return __tmp -= __i; ^ /usr/include/c++/4.8/bits/stl_bvector.h: At global scope: /usr/include/c++/4.8/bits/stl_bvector.h:293:13: error: declaration of 'operator+' as non-function operator+(ptrdiff_t __n, const _Bit_iterator& __x) ^ /usr/include/c++/4.8/bits/stl_bvector.h:293:13: error: 'ptrdiff_t' was not declared in this scope /usr/include/c++/4.8/bits/stl_bvector.h:293:28: error: expected primary-expression before 'const' operator+(ptrdiff_t __n, const _Bit_iterator& __x) ^ /usr/include/c++/4.8/bits/stl_bvector.h:346:16: error: declaration of 'operator+=' as non-function operator+=(difference_type __i) ^ /usr/include/c++/4.8/bits/stl_bvector.h:346:13: error: expected ';' at end of member declaration operator+=(difference_type __i) ^ /usr/include/c++/4.8/bits/stl_bvector.h:346:32: error: expected ')' before '__i' operator+=(difference_type __i) ^ /usr/include/c++/4.8/bits/stl_bvector.h:353:16: error: declaration of 'operator-=' as non-function operator-=(difference_type __i) ^ /usr/include/c++/4.8/bits/stl_bvector.h:353:13: error: expected ';' at end of member declaration operator-=(difference_type __i) ^ /usr/include/c++/4.8/bits/stl_bvector.h:353:32: error: expected ')' before '__i' operator-=(difference_type __i) ^ /usr/include/c++/4.8/bits/stl_bvector.h:360:15: error: 'difference_type' has not been declared operator+(difference_type __i) const ^ /usr/include/c++/4.8/bits/stl_bvector.h:367:15: error: 'difference_type' has not been declared operator-(difference_type __i) const ^ /usr/include/c++/4.8/bits/stl_bvector.h:374:16: error: 'difference_type' has not been declared operator[](difference_type __i) const ^ /usr/include/c++/4.8/bits/stl_bvector.h: In member function 'std::_Bit_const_iterator::const_iterator std::_Bit_const_iterator::operator+(int) const': /usr/include/c++/4.8/bits/stl_bvector.h:363:20: error: no match for 'operator+=' (operand types are 'std::_Bit_const_iterator::const_iterator {aka std::_Bit_const_iterator}' and 'int') return __tmp += __i; ^ /usr/include/c++/4.8/bits/stl_bvector.h: In member function 'std::_Bit_const_iterator::const_iterator std::_Bit_const_iterator::operator-(int) const': /usr/include/c++/4.8/bits/stl_bvector.h:370:20: error: no match for 'operator-=' (operand types are 'std::_Bit_const_iterator::const_iterator {aka std::_Bit_const_iterator}' and 'int') return __tmp -= __i; ^ /usr/include/c++/4.8/bits/stl_bvector.h: At global scope: /usr/include/c++/4.8/bits/stl_bvector.h:379:13: error: declaration of 'operator+' as non-function operator+(ptrdiff_t __n, const _Bit_const_iterator& __x) ^ /usr/include/c++/4.8/bits/stl_bvector.h:379:13: error: 'ptrdiff_t' was not declared in this scope /usr/include/c++/4.8/bits/stl_bvector.h:379:28: error: expected primary-expression before 'const' operator+(ptrdiff_t __n, const _Bit_const_iterator& __x) ^ /usr/include/c++/4.8/bits/stl_bvector.h:529:13: error: 'ptrdiff_t' does not name a type typedef ptrdiff_t difference_type; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/bits/stl_iterator.h: In instantiation of 'class std::reverse_iterator<std::_Bit_iterator>': /usr/include/c++/4.8/bits/stl_bvector.h:705:5: required from here /usr/include/c++/4.8/bits/stl_iterator.h:110:55: error: no type named 'difference_type' in 'struct std::iterator_traits<std::_Bit_iterator>' typedef typename __traits_type::difference_type difference_type; ^ /usr/include/c++/4.8/bits/stl_iterator.h:111:48: error: no type named 'pointer' in 'struct std::iterator_traits<std::_Bit_iterator>' typedef typename __traits_type::pointer pointer; ^ /usr/include/c++/4.8/bits/stl_iterator.h:112:50: error: no type named 'reference' in 'struct std::iterator_traits<std::_Bit_iterator>' typedef typename __traits_type::reference reference; ^ /usr/include/c++/4.8/bits/stl_iterator.h: In instantiation of 'class std::reverse_iterator<std::_Bit_const_iterator>': /usr/include/c++/4.8/bits/stl_bvector.h:709:5: required from here /usr/include/c++/4.8/bits/stl_iterator.h:110:55: error: no type named 'difference_type' in 'struct std::iterator_traits<std::_Bit_const_iterator>' typedef typename __traits_type::difference_type difference_type; ^ /usr/include/c++/4.8/bits/stl_iterator.h:111:48: error: no type named 'pointer' in 'struct std::iterator_traits<std::_Bit_const_iterator>' typedef typename __traits_type::pointer pointer; ^ /usr/include/c++/4.8/bits/stl_iterator.h:112:50: error: no type named 'reference' in 'struct std::iterator_traits<std::_Bit_const_iterator>' typedef typename __traits_type::reference reference; ^ In file included from /usr/include/c++/4.8/vector:65:0, from lant2.cpp:3: /usr/include/c++/4.8/bits/stl_bvector.h: In member function 'std::vector<bool, _Alloc>::size_type std::vector<bool, _Alloc>::max_size() const': /usr/include/c++/4.8/bits/stl_bvector.h:745:30: error: 'difference_type' was not declared in this scope __gnu_cxx::__numeric_traits<difference_type>::__max ^ /usr/include/c++/4.8/bits/stl_bvector.h:745:45: error: template argument 1 is invalid __gnu_cxx::__numeric_traits<difference_type>::__max ^ /usr/include/c++/4.8/bits/stl_bvector.h: In member function 'std::vector<bool, _Alloc>::iterator std::vector<bool, _Alloc>::insert(std::vector<bool, _Alloc>::iterator, const bool&)': /usr/include/c++/4.8/bits/stl_bvector.h:860:13: error: 'difference_type' does not name a type const difference_type __n = __position - begin(); ^ /usr/include/c++/4.8/bits/stl_bvector.h:866:24: error: '__n' was not declared in this scope return begin() + __n; ^ /usr/include/c++/4.8/bits/stl_bvector.h: In member function 'void std::vector<bool, _Alloc>::resize(std::vector<bool, _Alloc>::size_type, bool)': /usr/include/c++/4.8/bits/stl_bvector.h:921:61: error: there are no arguments to 'difference_type' that depend on a template parameter, so a declaration of 'difference_type' must be available [-fpermissive] _M_erase_at_end(begin() + difference_type(__new_size)); ^ /usr/include/c++/4.8/bits/stl_bvector.h:921:61: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) /usr/include/c++/4.8/bits/stl_bvector.h: In member function 'void std::vector<bool, _Alloc>::_M_initialize(std::vector<bool, _Alloc>::size_type)': /usr/include/c++/4.8/bits/stl_bvector.h:962:77: error: there are no arguments to 'difference_type' that depend on a template parameter, so a declaration of 'difference_type' must be available [-fpermissive] this->_M_impl._M_finish = this->_M_impl._M_start + difference_type(__n); ^ In file included from /usr/include/c++/4.8/vector:69:0, from lant2.cpp:3: /usr/include/c++/4.8/bits/vector.tcc: In member function 'void std::vector<bool, _Alloc>::_M_fill_insert(std::vector<bool, _Alloc>::iterator, std::vector<bool, _Alloc>::size_type, bool)': /usr/include/c++/4.8/bits/vector.tcc:712:54: error: there are no arguments to 'difference_type' that depend on a template parameter, so a declaration of 'difference_type' must be available [-fpermissive] this->_M_impl._M_finish + difference_type(__n)); ^ /usr/include/c++/4.8/bits/vector.tcc:713:58: error: there are no arguments to 'difference_type' that depend on a template parameter, so a declaration of 'difference_type' must be available [-fpermissive] std::fill(__position, __position + difference_type(__n), __x); ^ /usr/include/c++/4.8/bits/vector.tcc:714:50: error: there are no arguments to 'difference_type' that depend on a template parameter, so a declaration of 'difference_type' must be available [-fpermissive] this->_M_impl._M_finish += difference_type(__n); ^ /usr/include/c++/4.8/bits/vector.tcc:723:44: error: there are no arguments to 'difference_type' that depend on a template parameter, so a declaration of 'difference_type' must be available [-fpermissive] std::fill(__i, __i + difference_type(__n), __x); ^ /usr/include/c++/4.8/bits/vector.tcc:725:37: error: there are no arguments to 'difference_type' that depend on a template parameter, so a declaration of 'difference_type' must be available [-fpermissive] __i + difference_type(__n)); ^ /usr/include/c++/4.8/bits/vector.tcc: In member function 'void std::vector<bool, _Alloc>::_M_insert_range(std::vector<bool, _Alloc>::iterator, _ForwardIterator, _ForwardIterator, std::forward_iterator_tag)': /usr/include/c++/4.8/bits/vector.tcc:746:29: error: there are no arguments to 'difference_type' that depend on a template parameter, so a declaration of 'difference_type' must be available [-fpermissive] + difference_type(__n)); ^ /usr/include/c++/4.8/bits/vector.tcc:748:49: error: there are no arguments to 'difference_type' that depend on a template parameter, so a declaration of 'difference_type' must be available [-fpermissive] this->_M_impl._M_finish += difference_type(__n); ^ In file included from /usr/include/c++/4.8/ext/alloc_traits.h:36:0, from /usr/include/c++/4.8/bits/stl_construct.h:61, from /usr/include/c++/4.8/vector:62, from lant2.cpp:3: /usr/include/c++/4.8/bits/alloc_traits.h: In instantiation of 'struct std::allocator_traits<std::allocator<int> >': /usr/include/c++/4.8/ext/alloc_traits.h:121:10: required from 'struct __gnu_cxx::__alloc_traits<std::allocator<int> >' /usr/include/c++/4.8/bits/stl_vector.h:75:28: required from 'struct std::_Vector_base<int, std::allocator<int> >' /usr/include/c++/4.8/bits/stl_vector.h:210:11: required from 'class std::vector<int>' lant2.cpp:9:18: required from here /usr/include/c++/4.8/bits/alloc_traits.h:142:1: error: no type named 'difference_type' in 'struct std::pointer_traits<int*>' _GLIBCXX_ALLOC_TR_NESTED_TYPE(difference_type, ^ /usr/include/c++/4.8/bits/alloc_traits.h:142:1: error: no matching function for call to 'std::allocator_traits<std::allocator<int> >::_S_difference_type_helper(std::allocator<int>*)' _GLIBCXX_ALLOC_TR_NESTED_TYPE(difference_type, ^ /usr/include/c++/4.8/bits/alloc_traits.h:142:1: note: candidate is: /usr/include/c++/4.8/bits/alloc_traits.h:142:1: note: template<class _Tp> static typename _Tp::difference_type std::allocator_traits<_Alloc>::_S_difference_type_helper(_Tp*) [with _Tp = _Tp; _Alloc = std::allocator<int>] _GLIBCXX_ALLOC_TR_NESTED_TYPE(difference_type, ^ /usr/include/c++/4.8/bits/alloc_traits.h:142:1: note: template argument deduction/substitution failed: /usr/include/c++/4.8/bits/alloc_traits.h: In substitution of 'template<class _Tp> static typename _Tp::difference_type std::allocator_traits<_Alloc>::_S_difference_type_helper(_Tp*) [with _Tp = _Tp; _Alloc = std::allocator<int>] [with _Tp = std::allocator<int>]': /usr/include/c++/4.8/bits/alloc_traits.h:142:1: required from 'struct std::allocator_traits<std::allocator<int> >' /usr/include/c++/4.8/ext/alloc_traits.h:121:10: required from 'struct __gnu_cxx::__alloc_traits<std::allocator<int> >' /usr/include/c++/4.8/bits/stl_vector.h:75:28: required from 'struct std::_Vector_base<int, std::allocator<int> >' /usr/include/c++/4.8/bits/stl_vector.h:210:11: required from 'class std::vector<int>' lant2.cpp:9:18: required from here /usr/include/c++/4.8/bits/alloc_traits.h:142:1: error: no type named 'difference_type' in 'class std::allocator<int>' lant2.cpp: In function 'void Citire()': lant2.cpp:19:5: error: 'ifstream' was not declared in this scope ifstream fin("lant2.in"); ^ lant2.cpp:19:14: error: expected ';' before 'fin' ifstream fin("lant2.in"); ^ lant2.cpp:20:5: error: 'fin' was not declared in this scope fin >> K; ^ lant2.cpp: In function 'void NrLanturi()': lant2.cpp:92:5: error: 'ofstream' was not declared in this scope ofstream fout("lant2.out"); ^ lant2.cpp:92:14: error: expected ';' before 'fout' ofstream fout("lant2.out"); ^ lant2.cpp:93:5: error: 'fout' was not declared in this scope fout << rez << "\n"; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/vector:60, from lant2.cpp:3: /usr/include/c++/4.8/bits/stl_iterator.h: In instantiation of 'class std::move_iterator<int*>': /usr/include/c++/4.8/bits/stl_uninitialized.h:280:3: required from '_ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = int*; _ForwardIterator = int*; _Allocator = std::allocator<int>]' /usr/include/c++/4.8/bits/vector.tcc:415:43: required from 'void std::vector<_Tp, _Alloc>::_M_emplace_back_aux(_Args&& ...) [with _Args = {const int&}; _Tp = int; _Alloc = std::allocator<int>]' /usr/include/c++/4.8/bits/stl_vector.h:911:27: required from 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::value_type = int]' lant2.cpp:74:33: required from here /usr/include/c++/4.8/bits/stl_iterator.h:941:55: error: no type named 'difference_type' in 'struct std::iterator_traits<int*>' typedef typename __traits_type::difference_type difference_type; ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/c++allocator.h:33:0, from /usr/include/c++/4.8/bits/allocator.h:46, from /usr/include/c++/4.8/vector:61, from lant2.cpp:3: /usr/include/c++/4.8/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = int; _Args = {const int&}; _Tp = int]': /usr/include/c++/4.8/bits/alloc_traits.h:254:4: required from 'static typename std::enable_if<std::allocator_traits<_Alloc>::__construct_helper<_Tp, _Args>::value, void>::type std::allocator_traits<_Alloc>::_S_construct(_Alloc&, _Tp*, _Args&& ...) [with _Tp = int; _Args = {const int&}; _Alloc = std::allocator<int>; typename std::enable_if<std::allocator_traits<_Alloc>::__construct_helper<_Tp, _Args>::value, void>::type = void]' /usr/include/c++/4.8/bits/alloc_traits.h:393:57: required from 'static decltype (_S_construct(__a, __p, (forward<_Args>)(std::allocator_traits::construct::__args)...)) std::allocator_traits<_Alloc>::construct(_Alloc&, _Tp*, _Args&& ...) [with _Tp = int; _Args = {const int&}; _Alloc = std::allocator<int>; decltype (_S_construct(__a, __p, (forward<_Args>)(std::allocator_traits::construct::__args)...)) = <type error>]' /usr/include/c++/4.8/bits/stl_vector.h:906:34: required from 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::value_type = int]' lant2.cpp:74:33: required from here /usr/include/c++/4.8/ext/new_allocator.h:120:4: error: no matching function for call to 'operator new(sizetype, void*)' { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } ^ /usr/include/c++/4.8/ext/new_allocator.h:120:4: note: candidate is: <built-in>:0:0: note: void* operator new(unsigned int) <built-in>:0:0: note: candidate expects 1 argument, 2 provided
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema lant2 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ă.