Submission #892625

#TimeUsernameProblemLanguageResultExecution timeMemory
892625NurislamSuper Dango Maker (JOI22_dango3)C++17
0 / 100
1 ms348 KiB
#include <bits/stdc++.h> #include "dango3.h" using namespace std; #define ff first #define ss second #define pb push_back #define all(x) x.begin(),x.end() #define rall(x) x.rbegin(),x.rend() //~ #define int long long typedef vector<int> vi; typedef pair<int,int> pii; typedef vector<pair<int,int> > vii; /* __ __ __ */ /* ====== _ /| /| __ _ / | | /| | @ | | | | / /| |\ | / | | @ | / */ /* || |_| |_ / |/ | | | |_ |- | |--| /-| | | \ \ |==| |- /=| | \ | | |--| | |- */ /* || | | |_ / | |__| _| |_ \__ | | / | |__ | __| | | | \ / | | \| \__ | | | | \ */ /* */ void Solve(int N, int M) { queue<pair<vi, int> > q; vi v; for(int i = 1; i <= N*M; i++){ v.pb(i); } q.push({v, M}); while(q.empty()){ auto [a, m] = q.front(); q.pop(); if(m <= 1){ Answer(a); continue; }else{ int n = a.size(); int us[n]{}; for(int i = 0; i < n; i++){ us[i] = 1; vi res; for(int j = 0; j < n; j++){ if(!us[j])res.pb(a[j]); } if(Query(res) < m/2)us[i] = 0; } vi g1,g2; for(int i = 0; i < n; i++){ if(us[i]==0)g1.pb(v[i]); else g2.pb(v[i]); } q.push({g1,m/2}); if(m%2==1)q.push({g2,m/2+1}); else q.push({g2,m/2}); } } return; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...