# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
930682 | Tuanlinh123 | Mouse (info1cup19_mouse) | C++17 | 0 ms | 0 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 "perm.h"
#include<bits/stdc++.h>
#define ll int
#define pll pair<ll, ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ld long double
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
void findPermutation(ll n)
{
ll q=n>50?2400:n>7?400:50;
vector <vector <ll>> p(n+1, vector <ll> (n+1, 1));
vector <ll> crr(n);
for (ll i=0; i<q-1; i++)
{
if (i%n==0)
{
iota(crr.begin(), crr.end(), 1);
shuffle(crr.begin(), crr.end(), rng);
}
else rotate(crr.begin(), crr.begin()+1, crr.end());
if (!query(crr)) for (ll i=0; i<n; i++)
p[i+1][crr[i]]=0;
}
vector <ll> ans;
for (ll i=1; i<=n; i++)
for (ll j=1; j<=n; j++)
if (p[i][j]) {ans.pb(j); break;}
query(ans);
}