# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
754865 | definitelynotmee | Super Dango Maker (JOI22_dango3) | C++17 | 3571 ms | 832 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "dango3.h"
#include<bits/stdc++.h>
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template<typename T>
using matrix = vector<vector<T>>;
namespace {
int variable_example = 1;
} // namespace
void Solve(int N, int M) {
matrix<int> resp(M);
for(int i = 1; i <= N*M; i++){
int ini = 0, fim = M-1;
while(ini!=fim){
int m = (ini+fim)>>1;
vector<int> ban(N*M);
for(int i = m+1; i < M; i++){
for(int j : resp[i])
ban[j] = 1;
}
ban[i] = 1;
vector<int> qry;
for(int i = 1; i <= N*M; i++){
if(!ban[i])
qry.push_back(i);
}
if(Query(qry) <= m)
fim = m;
else ini = m+1;
}
resp[ini].push_back(i);
}
// for(int i = 0; i < M; i++){
// for(int j : resp[i])
// cout << j << ' ';
// cout << '\n';
// }
for(int i = 0; i < M; i++)
Answer(resp[i]);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |