# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
238863 | Sorting | Secret Permutation (RMI19_permutation) | C++14 | 3431 ms | 384 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>
#include "permutationc.h"
using namespace std;
int query(int v[]);
int query(vector<int> v);
void answer(int v[]);
void answer(vector<int> v);
void solve(int n){
vector<int> v;
for(int i = 1; i <= n; ++i)
v.push_back(i);
do{
if(query(v) == n - 1){
vector<int> p(n);
for(int i = 0; i < n; ++i)
p[v[i] - 1] = i + 1;
answer(p);
return;
}
}
while(next_permutation(v.begin(), v.end()));
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |