Submission #3817

# Submission time Handle Problem Language Result Execution time Memory
3817 2013-08-31T08:33:21 Z MiNu Inherited disease (kriii1_I) C++
0 / 1
0 ms 1672 KB
#include <iostream>
#include <cstdio>
using namespace std;

#define MOD 1000000007

int main()
{
    int D;
    scanf("%d", &D);

    long long first[128] = { 0, 1, 2};
    for ( int i=3 ; i<=D ; ++i )
    {
        first[i] = (first[i-1] + (i-1)*(i-2)) % MOD;
    }

    long long curr = 0;
    for ( int i=1 ; i<=D ; ++i )
    {
        int k;
        scanf("%d", &k);

        curr = first[i] + (curr - first[i-1]) * i + k - 1;
        curr %= MOD;
        printf("%lld\n", curr);
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1672 KB Output isn't correct
2 Halted 0 ms 0 KB -