Problem fibo
User Ash
Submission Time 2024-04-18 19:59:13
Score 0
Max Time N/A
Max Memory N/A

Compile Error

fibo.cpp: In function ‘void solve()’:
fibo.cpp:23:13: error: no match for ‘operator+=’ (operand types are ‘__gnu_cxx::__alloc_traits<std::allocator<modular>, modular>::value_type’ {aka ‘modular’} and ‘__gnu_cxx::__alloc_traits<std::allocator<modular>, modular>::value_type’ {aka ‘modular’})
23 | dp[i % 2] += dp[1-(i % 2)];
In file included from /usr/include/c++/9/bits/stl_tempbuf.h:60,
from /usr/include/c++/9/bits/stl_algo.h:62,
from /usr/include/c++/9/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
from fibo.cpp:1:
/usr/include/c++/9/bits/stl_construct.h: In instantiation of ‘void std::_Construct(_T1*, _Args&& ...) [with _T1 = modular; _Args = {}]’:
/usr/include/c++/9/bits/stl_uninitialized.h:545:18: required from ‘static _ForwardIterator std::__uninitialized_default_n_1<_TrivialValueType>::__uninit_default_n(_ForwardIterator, _Siz