Submission #892630

#TimeUsernameProblemLanguageResultExecution timeMemory
892630NurislamSuper Dango Maker (JOI22_dango3)C++17
0 / 100
1 ms348 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; /* __ __ __ */ /* ====== _ /| /| __ _ / | | /| | @ | | | | / /| |\ | / | | @ | / */ /* || |_| |_ / |/ | | | |_ |- | |--| /-| | | \ \ |==| |- /=| | \ | | |--| | |- */ /* || | | |_ / | |__| _| |_ \__ | | / | |__ | __| | | | \ / | | \| \__ | | | | \ */ /* */ void Solve(int N, int M) { queue<pair<vector<int>, int> > q; vector<int> a; for(int i = 1; i <= N*M; i++){ a.push_back(i); } q.push({a, M}); while(q.empty()){ auto [v, k] = q.front(); q.pop(); if(k <= 1){ Answer(v); continue; }else{ int n = v.size(); vector <int> used(n); for(int i = 0; i < n; i++){ used[i]=1; vector <int> x; for(int j = 0; j < n; j++){ if(used[j] == 0)x.push_back(v[j]); } if(Query(x) < k/2)used[i]=0; } vector <int> g1,g2; for(int i = 0; i < n; i++){ if(used[i]==0)g1.push_back(v[i]); else g2.push_back(v[i]); } q.push({g1,k/2}); if(k%2==1)q.push({g2,k/2+1}); else q.push({g2,k/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...