Submission #3698

#TimeUsernameProblemLanguageResultExecution timeMemory
3698eldkqmfhf123Inherited disease (kriii1_I)C++98
0 / 1
0 ms1676 KiB
#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 timeMemoryGrader output
Fetching results...