# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3698 | eldkqmfhf123 | Inherited disease (kriii1_I) | C++98 | 0 ms | 1676 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>
using namespace std;
long long g[101];
long long sum[101];
long long in[101];
int main(void){
int n;
int i, j;
g[1] = 1;
sum[1] = 1;
for(i=2; i<=100; i++){
g[i] = (g[i-1] * i) % 1000000007;
sum[i] = (sum[i-1] + g[i]) % 1000000007;
}
cin >>n;
for(i=1; i<=n; i++)
cin >>in[i];
cout <<1<<endl;
for(i=2; i<=n; i++){
cout << (( ( (in[i-1]-1)*i)%1000000007) + in[i] + sum[i-1] ) % 1000000007 <<endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |