제출 #1125816

#제출 시각아이디문제언어결과실행 시간메모리
1125816efishel사육제 (CEOI14_carnival)C++20
20 / 100
37 ms432 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector <ll>; using ii = pair <ll, ll>; using vii = vector <ii>; ll fask (vll ve) { if (ve.size() == 0) return 0; cout << ve.size() << ' '; for (ll i : ve) cout << i+1 << ' '; cout << '\n' << flush; ll res; cin >> res; return res; } void answer (vll ve) { cout << "0 "; for (ll i : ve) cout << i << ' '; cout << '\n' << flush; } int main () { cin.tie(nullptr) -> sync_with_stdio(false); ll n; cin >> n; vll key(n, -16); ll timer = 1; for (ll i = 0; i < n; i++) { ll j = 0; while (j < i) { if (fask({ j, i }) == 1) { key[i] = key[j]; break; } j++; } if (j == i) key[i] = timer++; } answer(key); 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...