#include <stdio.h>
#include <vector>
int D;
std::vector<int> C;
std::vector<int> M;
std::vector<int> NC;
int main()
{
scanf("%d", &D);
for ( int i = 0 ; i < D ; i++)
{
int tmp;
scanf("%d", &tmp);
C.push_back(tmp);
}
M.push_back(0);
NC.push_back(1);
for ( int i = 1 ; i <= D ; i++)
{
NC.push_back( i * NC[i-1] );
}
long long P = 0;
long long PP = 0;
long long PPP = 1;
printf("%d\n", 1);
PP = 1;
for ( int i = 1 ; i < D ; i++)
{
P = PP;
P += (PPP-1)*(i+1);
P += C[i];
printf("%d\n", P%1000000007);
PP += NC[i+1];
PPP = C[i];
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
1204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |