Submission #534618

#TimeUsernameProblemLanguageResultExecution timeMemory
534618haxormanCarnival (CEOI14_carnival)C++14
20 / 100
92 ms200 KiB
#include <bits/stdc++.h> using namespace std; const int mxN = 157; int ans[mxN]; int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; int cur = 1; set<int> zeros; for (int i = 1; i <= n; ++i) { zeros.insert(i); } for (int i = 1; i <= n; ++i) { if (!ans[i]) { ans[i] = cur++; if (zeros.size() == 1) { break; } cout << zeros.size() << ' '; for (auto zero : zeros) { cout << zero << ' '; } cout << endl; int k; cin >> k; k = zeros.size() - k; zeros.erase(i); for (int j = i + 1; j <= n && k; ++j) { if (!ans[j]) { cout << "2 " << i << ' ' << j << endl; int num; cin >> num; if (num == 1) { ans[j] = ans[i]; zeros.erase(j); --k; } } } } } cout << "0 "; for (int i = 1; i <= n; ++i) { cout << ans[i] << ' '; } cout << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...