Submission #551337

#TimeUsernameProblemLanguageResultExecution timeMemory
551337AugustinasJucasCarnival (CEOI14_carnival)C++14
20 / 100
83 ms292 KiB
#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 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...