This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |