Submission #949503

#TimeUsernameProblemLanguageResultExecution timeMemory
949503alextodoranSuper Dango Maker (JOI22_dango3)C++17
0 / 100
239 ms15192 KiB
/** _ _ __ _ _ _ _ _ _ |a ||t ||o d | |o | | __ _| | _ | __| _ | | __ |/_ | __ /__\ / _\| **/ #include <bits/stdc++.h> #include "dango3.h" using namespace std; typedef long long ll; int Query (const vector <int> &x); void Answer (const vector <int> &a); int N, M; void solve (vector <int> v) { int k = (int) v.size(); int m = (int) v.size() / N; if (m == 1) { for (int &i : v) { i++; } Answer(v); return; } m /= 2; bool in[k]; fill(in, in + k, true); for (int i : v) { in[i] = false; vector <int> x; for (int j : v) { if (in[j] == true) { x.push_back(j + 1); } } if (Query(x) < m) { in[i] = true; } } vector <int> split[2]; for (int i : v) { split[in[i]].push_back(i); } solve(split[0]); solve(split[1]); } void Solve (int _N, int _M) { N = _N; M = _M; vector <int> v(N * M); iota(v.begin(), v.end(), 0); solve(v); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...