Submission #422476

#TimeUsernameProblemLanguageResultExecution timeMemory
422476snasibov05Carnival (CEOI14_carnival)C++14
20 / 100
150 ms200 KiB
#include <iostream> #include <vector> using namespace std; #define pb push_back int ask(vector<int> v){ cout << v.size() << " "; for (auto x : v) cout << x << " "; cout << endl; int res; cin >> res; return res; } void answer(vector<int> ans){ int n = ans.size() - 1; cout << "0 "; for (int i = 1; i <= n; ++i){ cout << ans[i] << " "; } cout << "\n"; } int main() { int n; cin >> n; vector<int> ans(n+1); ans[1] = 1; int k = 2; for (int i = 2; i <= n; ++i){ vector<int> v; v.pb(i); for (int j = 1; j < i; ++j) { v.pb(j); int x = ask(v); if (x == 1){ ans[i] = ans[j]; break; } v.pop_back(); } if (ans[i] == 0) ans[i] = k++; } answer(ans); 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...