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;
int vis[10005];
void Solve(int N, int M) {
vector<int> SOL[M];
for (int i = 0; i < N; i++){
unordered_set<int> idx;
for (int j = 1; j <= N*M; j++) idx.insert(j);
int cur = M;
vector<int> corr;
for (int j = 1; j <= N*M; j++){
if (vis[j]) continue;
idx.erase(j);
vector<int> v;
for (auto x : idx) v.emplace_back(x);
int res = Query(v);
if (res < cur){
vis[j] = 1;
corr.push_back(j);
cur = res;
}
else idx.insert(j);
}
/*printf("group %d: ",i);
for (auto x : corr) printf("%d ",x);
printf("\n");*/
for (int j = 0; j < M; j++){
SOL[j].push_back(corr[j]);
}
}
for (int i = 0; i < M; i++) {
Answer(SOL[i]);
}
}
# | 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... |