Fybonačis

Taškai: 0

Compile: FAIL

phi_bonacci.cpp: In function ‘long long int fibonV2(const std::vector<long long int>&, int, int)’: phi_bonacci.cpp:13:20: error: passing ‘const std::vector<long long int>’ as ‘this’ argument discards qualifiers [-fpermissive] 13 | a.push_back(sum); | ~~~~~~~~~~~^~~~~ In file included from /usr/include/c++/11/vector:67, from phi_bonacci.cpp:2: /usr/include/c++/11/bits/stl_vector.h:1187:7: note: in call to ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; std::vector<_Tp, _Alloc>::value_type = long long int]’ 1187 | push_back(const value_type& __x) | ^~~~~~~~~ phi_bonacci.cpp:14:45: error: ‘MOD’ was not declared in this scope 14 | sum = (2 * sum - a[0] + a[q - 1]) % MOD; | ^~~ phi_bonacci.cpp:15:16: error: passing ‘const std::vector<long long int>’ as ‘this’ argument discards qualifiers [-fpermissive] 15 | a.erase(a.begin()); | ~~~~~~~^~~~~~~~~~~ In file included from /usr/include/c++/11/vector:67, from phi_bonacci.cpp:2: /usr/include/c++/11/bits/stl_vector.h:1430:7: note: in call to ‘std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::const_iterator) [with _Tp = long long int; _Alloc = std::allocator<long long int>; std::vector<_Tp, _Alloc>::iterator = std::vector<long long int>::iterator; std::vector<_Tp, _Alloc>::const_iterator = std::vector<long long int>::const_iterator]’ 1430 | erase(const_iterator __position) | ^~~~~

nr.resulttimemessage