Submission #19689

# Submission time Handle Problem Language Result Execution time Memory
19689 2016-02-25T04:35:22 Z onjo0127 괄호 (kriii4_R) C++
0 / 100
0 ms 4988 KB
#include <stdio.h>
#define MOD 1000000007

int dp[1000009];

int main()
{
    int n,k,i;
    scanf("%d %d",&n,&k);

    if(n==1) {
        printf("1");
        return 0;
    }
    if(n%2) {
        printf("2");
        return 0;
    }

    dp[0] = 1;
    dp[1] = 1;
    for(i=2;i<=n;i+=2) {
        dp[i] = dp[i-2] + 1;
        dp[i] %= MOD;
    }

    printf("%d",dp[n]);
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 4988 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -