# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
22629 | 2000/4000 (#40) | Fully Generate (KRIII5_FG) | C++14 | 9 ms | 5020 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 <cstdio>
const int P = 1000'000'007;
int N;
int A[1000004];
int main() {
scanf("%d", &N);
if (N > 1000000) {
puts("Too Big!");
return 0;
}
long long p = 1;
A[1] = 1;
for (int i = 1; i < N; ++i) {
A[i + 1] = 1 + A[i + 1 - A[A[i]]];
p = p * A[i + 1] % P;
}
printf("%lld\n", p);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |