Submission #668111

#TimeUsernameProblemLanguageResultExecution timeMemory
668111AriadnaCarnival (CEOI14_carnival)C++14
100 / 100
33 ms208 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector < int > c(n, 0); vector < bool > b(n, true); int friends = 1; for (int i = 0; i < n; ++i) { cout << friends << " "; for (int j = 0; j <= i; ++j) { if (b[j]) { cout << j + 1 << " "; } } cout << endl; int costumes; cin >> costumes; if (costumes == friends) { c[i] = costumes; ++friends; } else { int aux = friends; for (int j = 0; j < i && !c[i]; ++j) { if (b[j]) { if (j == i - 1) { c[i] = c[j]; continue; } --aux; cout << aux << " "; for (int k = j + 1; k <= i; ++k) { if (b[k]) cout << k + 1 << " "; } cout << endl; int ans; cin >> ans; if (ans == aux) { c[i] = c[j]; } } } b[i] = false; } } cout << 0 << endl; for (int i = 0; i < n; ++i) { cout << c[i] << " "; } 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...