#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
1672 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |