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 <bits/stdc++.h>
using namespace std;
const int dydis = 151;
int type[dydis];
int ask(vector<int> vec) {
cout << vec.size() << " ";
for(auto &x : vec) cout << x+1 << " ";
cout << endl;
int ans;
cin >> ans;
return ans;
}
int main () {
int n;
cin >> n;
for(int i = 0; i < n; i++) type[i] = -1;
int ind = 0;
for(int i = 0; i < n; i++) {
if(type[i] != -1) continue;
type[i] = ind++;
for(int j = i+1; j < n; j++) {
if(type[j] != -1) continue;
if(ask({i, j}) == 1) {
type[j] = type[i];
}
}
}
cout << "0 ";
for(int i = 0; i < n; i++) {
cout << type[i] + 1 << " ";
}
cout << endl;
return 0;
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |