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>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <functional>
#include <map>
#include <set>
#include <string>
using namespace std;
int N, K, T;
int con[1111111] = { 0, 1, 2, 2, 3, 3 };
int idx = 6;
int main()
{
cin >> N;
int i = 4;
while (idx <= N)
{
int val = con[i];
for (int j = 0; j < val; j++)
{
con[idx++] = i;
if (idx > N)
break;
}
i++;
}
long long mult = 1;
for (int i = 1; i <= N; i++)
mult = (mult * con[i]) % 1000000007;
cout << mult % 1000000007;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |