# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
577343 | handlename | Permutation (APIO22_perm) | C++17 | 7 ms | 364 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 <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
const int MOD=1e9+7;
int n;
bool prime[1001];
bool lmao;
vector<int> primes;
vector<int> construct_permutation(long long k){
vector<int> temp;
if (k==1) return temp;
temp.pb(0);
if (k==2) return temp;
if (!lmao){
memset(prime,true,sizeof(prime));
lmao=true;
for (int p=2;p<1001;p++){
if (prime[p]){
primes.pb(p);
for (int i=p*2;i<1001;i+=p){
prime[i]=false;
}
}
}
}
for (auto p:primes){
if (k%p==0 && k>p){
vector<int> a=construct_permutation(p);
int sz=a.size();
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |