MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / slow

Function slow

code/mathematics/linear_recurrence.test.cpp:1–11  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1ll slow(vector<ll> init, vector<ll> c, ll n, ll mod) {
2 while (n >= init.size()) {
3 ll cur = 0;
4 for (int i = 0; i < c.size(); i++) {
5 cur += c[i] * init[(int)init.size()-1-i] % mod;
6 if (cur >= mod) cur -= mod;
7 }
8 init.push_back(cur);
9 }
10 return init[n];
11}
12
13void test() {
14 // Field testing: Project Euler 258

Callers 1

testFunction · 0.70

Calls 2

push_backMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected