# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
685200 | heeheeheehaaw | Mouse (info1cup19_mouse) | C++17 | 1 ms | 208 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 "grader.h"
using namespace std;
void solve(int n)
{
vector<int> q, poz, rez;
for(int i = 1; i <= n; i++)
{
q.push_back(i);
poz.push_back(0);
rez.push_back(0);
}
int a = query(q);
while(a > 0 && a < n)
{
random_shuffle(q.begin(), q.end());
a = query(q);
}
if(a == n)
return;
for(int i = 0; i < q.size(); i++)
poz[q[i]] = i;
for(int i = 1; i <= n; i++)
{
if(rez[i - 1] != 0)
continue;
for(int j = 0; j < n; j++)
{
if(poz[i] != j)
swap(q[j], q[poz[i]]);
a = query(q);
if(a >= 1) rez[j] = i;
if(a == 2) rez[poz[i]] = q[poz[i]];
if(poz[i] != j)
swap(q[j], q[poz[i]]);
}
}
query(rez);
}
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... |