Submission #9285

#TimeUsernameProblemLanguageResultExecution timeMemory
9285dolpang2Phibonacci (kriii2_P)C++14
0 / 4
0 ms1672 KiB
#include <cstdio> #include <iostream> #include <string> #include <vector> const int a = 1000000007; int main() { std::vector<int> fibo; fibo.push_back(0); fibo.push_back(1); int n; int k; scanf("%d%d", &n, &k); if (k == 1) { for (int i = 2; i <= n; ++i) { int ret = fibo[i - 1] % a; ret += fibo[i - 2] % a; fibo.push_back(ret); } std::cout << fibo[n] << " " << fibo[n - 1]; } else { puts("no"); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...