Submission #3419

#TimeUsernameProblemLanguageResultExecution timeMemory
3419joinsungInherited disease (kriii1_I)C++98
1 / 1
0 ms1672 KiB
#include <iostream> using namespace std; #define MOD 1000000007 int main() { long long d; cin >> d; long long k[150]; for (long long di=0;di<d;di++) cin>>k[di]; cout << 1 << endl; long long last = 1; long long index = 0; long long count = 1; for (long long di=1;di<d;di++) { long long offset = index * (di+1) + k[di]; long long child = last + offset; child %= MOD; cout << child << endl; count *= di+1; count %= MOD; last += count; last %= MOD; index = offset-1; index %= MOD; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...