Submission #710771

#TimeUsernameProblemLanguageResultExecution timeMemory
710771uroskSuper Dango Maker (JOI22_dango3)C++17
7 / 100
5831 ms544 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],tu[maxn*maxm]; ll ask(){ w.clear(); for(ll i = 1;i<=n*m;i++) if(ok[i]) w.pb(i); return Query(w); } ll c = 2000; void Solve(int N, int M) { n = N; m = M; for(ll i = 1;i<=n*m;i++) v.pb(i); shuffle(all(v),rng); while(1){ vector<ll> w,id,ans; ll last,len,lenpoc; lol:; if(v.empty()) break; w.clear(); id.clear(); len = min((ll)v.size(),c); lenpoc = min((ll)v.size(),c); last = 0; //here; ///v.size() - k >= len for(ll j = 1;j<=lenpoc;j++){ ll k = rnd(last,(ll)v.size()-len); last = k+1; w.pb(v[k]); id.pb(k); len--; } for(ll x : w) ok[x] = tu[x] = 1; lol1:; if(!ask()){ for(ll x : w) ok[x] = tu[x] = 0; goto lol; } for(ll x : w){ ok[x] = 0; if(!ask()) ans.pb(x),ok[x] = 1; } //cer(ans); Answer(ans); for(ll x : ans){ v.erase(find(all(v),x)); tu[x] = 0; } ans.clear(); for(ll x : w) ok[x] = tu[x]; goto lol1; for(ll x : ans) ok[x] = 0; } } /** 3 2 3 3 1 2 1 2 4 4 2 2 3 2 4 4 3 2 3 1 1 3 4 1 4 1 **/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...