# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1005704 | enzy | Super Dango Maker (JOI22_dango3) | C++17 | 1522 ms | 912 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>
using namespace std;
void Solve(int n, int m) {
/*std::vector<int> x(3);
x[0] = 1;
x[1] = 2;
x[2] = 3;
variable_example = Query(x);
for (int i = 0; i < M; i++) {
vector<int> a(N);
for (int j = 0; j < N; j++) {
a[j] = N * i + j + 1;
}
Answer(a);
}*/
vector<int>v[m+1];
for(int i=1;i<=n*m;i++){
int l=1, r=m;
while(l<r){
int mid=(l+r)/2;
vector<int>q;
for(int j=i+1;j<=n*m;j++) q.push_back(j);
for(int j=mid+1;j<=m;j++)
for(int k=0;k<v[j].size();k++) q.push_back(v[j][k]);
int check=Query(q);
if(check>=m-mid) r=mid;
else l=mid+1;
}
v[l].push_back(i);
}
for(int i=1;i<=m;i++) Answer(v[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... |