# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3817 | MiNu | Inherited disease (kriii1_I) | C++98 | 0 ms | 1672 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 <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 |
---|---|---|---|---|
Fetching results... |