# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
19893 |
2016-02-25T06:48:10 Z |
king7282 |
괄호 (kriii4_R) |
C++ |
|
6 ms |
24520 KB |
#include <stdio.h>
#define ll long long
#define M 1000000007
ll dp[1000010], sum[2][1000010];
int main(void)
{
ll i, n, k;
scanf("%lld %lld", &n ,&k);
dp[1] = 1, dp[2] = 2;
sum[1][1] = 1, sum[0][2] = 3;
for(i = 3; i <= n; i++)
{
dp[i] = (dp[i - 1] + sum[i % 2][i - 2]) % M;
sum[i % 2][i] = (sum[i % 2][i - 2] + dp[i]) % M;
}
printf("%lld\n", dp[n]);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
24520 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |