# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3419 | joinsung | Inherited disease (kriii1_I) | C++98 | 0 ms | 1672 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;
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |