# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
22625 | JAESu_gak (#40) | Fully Generate (KRIII5_FG) | C++14 | 9 ms | 8928 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<stdio.h>
long long int n, garr[1000005], ans = 1;
int main()
{
int i, j, k;
scanf("%lld", &n);
garr[1] = 1;
garr[2] = 2;
garr[3] = 2;
k = 3;
for (i = 3; i <= n; i++)
{
for (j = 1; j <= garr[i]; j++)
{
garr[++k] = i;
if (k == n) break;
}
if (j != garr[i] + 1) break;
}
for (i = 1; i <= n; i++) ans = (ans*garr[i]) % 1000000007;
printf("%lld", ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |