Submission #621781

#TimeUsernameProblemLanguageResultExecution timeMemory
621781MinaRagy06Carnival (CEOI14_carnival)C++17
20 / 100
141 ms260 KiB
#include <bits/stdc++.h> using namespace std; #define lesgooo ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) // #define endl '\n' #define int long long int ask(vector<int> a) { cout << a.size() << " "; for (auto i : a) cout << i << " "; cout << endl; int ret; cin >> ret; return ret; } signed main() { lesgooo; int n; cin >> n; int par[n]{}; for (int i = 0; i < n; i++) par[i] = 1; for (int i = 0; i < n; i++) for (int j = i+1; j < n; j++) if (ask({i+1, j+1}) == 2 && par[j] == par[i]) par[j]++; cout << "0 "; for (int i = 0; i < n; i++) cout << par[i] << " "; cout << endl; return 0; } /* 2 1 2 3 1 */
#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...