#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 150 + 7;
bool found[N], root[N];
vector<int> same[N];
int sol[N];
int n;
int ask(vector<int> guys) {
cout << guys.size() << " ";
for (int i : guys) cout << i << " ";
cout << endl;
int res;
cin >> res;
return res;
}
int main() {
cin >> n;
for (int i = 1; i <= n; ++i) {
for (int j = i + 1; j <= n; ++j) {
if (found[j] == true) continue;
vector<int> v = {i, j};
if (ask(v) == 1) {
same[i].push_back(j);
root[i] = true;
found[j] = true;
}
}
}
for (int i = 1; i <= n; ++i) if (found[i] == 0) root[i] = 1;
int c = 0;
for (int i = 1; i <= n; ++i) {
if (root[i] == 1) {
++c;
sol[i] = c;
for (auto j : same[i]) {
sol[j] = c;
}
}
}
for (int i = 1; i <= n; ++i) cout << sol[i] << " ";
cout << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
344 KB |
Same person came twice to the party. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
500 KB |
Same person came twice to the party. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
436 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
344 KB |
Same person came twice to the party. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Same person came twice to the party. |
2 |
Halted |
0 ms |
0 KB |
- |