# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19751 | panda959595 | 괄호 (kriii4_R) | C++98 | 0 ms | 4796 KiB |
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 <string>
#include <cmath>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <list>
#include <stdio.h>
#include <string.h>
using namespace std;
int main()
{
vector<int> a;
int n;
int k;
cin >> n >> k;
a.push_back(1);
a.push_back(k);
int num;
for (int i = 2; i <= n; i++)
{
num = (a[i - 1] + a[i - 2])*k;
num %= 1000000007;
a.push_back(num);
}
cout << a[n] << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |