Submission #710745

#TimeUsernameProblemLanguageResultExecution timeMemory
710745uroskSuper Dango Maker (JOI22_dango3)C++17
2 / 100
10025 ms468 KiB
#include "dango3.h"
#define here cerr<<"===========================================\n"
#define dbg(x) cerr<<#x<<": "<<x<<endl;
#include "bits/stdc++.h"
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
#define ld double
#define ll int
#define llinf 100000000000000000LL // 10^17
#define pb push_back
#define popb pop_back
#define fi first
#define sc second
#define endl '\n'
#define pll pair<ll,ll>
#define pld pair<ld,ld>
#define all(a) a.begin(),a.end()
#define ceri(a,l,r) {cerr<<#a<<": ";for(ll i_ = l;i_<=r;i_++) cerr<<a[i_]<< " ";cerr<<endl;}
#define cer(a) {cerr<<#a<<": ";for(ll x_ : a) cerr<<x_<< " ";cerr<<endl;}

#define daj_mi_malo_vremena ios_base::sync_with_stdio(false);cerr.tie(0);cout.tie(0);cin.tie(0);

using namespace std;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll l,ll r){
    return uniform_int_distribution<ll>(l,r)(rng);
}

#define maxn 405
#define maxm 30
ll n,m;
vector<ll> v;
vector<ll> w;
bool ok[maxn*maxm];
ll ask(){
    w.clear();
    for(ll i = 1;i<=n*m;i++) if(ok[i]) w.pb(i);
    return Query(w);
}
bool vis[maxn*maxm];
void Solve(int N, int M) {
    n = N; m = M;
    for(ll i = 1;i<=n*m;i++) v.pb(i),ok[i] = 1;
    shuffle(all(v),rng);
    for(ll i = m;i>=1;i--){
        vector<ll> ans;
        while(1){
            for(ll j = 1;j<=n;j++){
                ll k = rnd(0,v.size()-1);
                ans.pb(v[k]);
                v.erase(v.begin()+k);
            }
            for(ll x : ans) ok[x] = 0;
            if(ask()==i-1) break;
            for(ll x : ans) ok[x] = 1,v.pb(x);
            ans.clear();
        }
        Answer(ans);
    }
}
/**
3 2
3 3 1 2 1 2

**/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...