# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
20121 |
2016-02-26T06:25:06 Z |
sys7961 |
괄호 (kriii4_R) |
C++14 |
|
3 ms |
1860 KB |
#include<stdio.h>
long long dy[100100];
long long m = 1000000007;
int main() {
long long n, k;
scanf("%lld%lld", &n, &k);
dy[0] = 1;
long long sum = 0;
long long p = 0;
for (int i = 0; i < n; i++) {
dy[i + 1] = (dy[i] * k)%m;
p += sum;
p %= m;
dy[i + 1] += p;
dy[i + 1] % m;
sum += dy[i + 1];
sum %= m;
}
printf("%lld", dy[n]);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
1860 KB |
SIGSEGV Segmentation fault |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |