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 <vector>
const int kModulo = 1000000007;
int main() {
int n = 0;
int k = 0;
scanf("%d%d", &n, &k);
int x = 0;
int y = 1;
for (int i = 2; i <= n; ++i) {
if (x > kModulo) x %= kModulo;
if (y > kModulo) y %= kModulo;
int temp = (x + y) % kModulo;
x = y;
y = temp;
}
printf("%d %d", y, x);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |