Submission #930685

# Submission time Handle Problem Language Result Execution time Memory
930685 2024-02-20T09:23:16 Z Tuanlinh123 Mouse (info1cup19_mouse) C++17
0 / 100
1 ms 440 KB
#include "grader.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 solve(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);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Correct! Number of queries: 50
2 Runtime error 0 ms 440 KB Execution killed with signal 13
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Correct! Number of queries: 50
2 Runtime error 0 ms 440 KB Execution killed with signal 13
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Correct! Number of queries: 50
2 Runtime error 0 ms 440 KB Execution killed with signal 13
3 Halted 0 ms 0 KB -