Submission #245681

#TimeUsernameProblemLanguageResultExecution timeMemory
245681RainbowbunnyCarnival (CEOI14_carnival)C++17
100 / 100
21 ms384 KiB
#include <bits/stdc++.h> #define mp make_pair #define eb emplace_back #define fi first #define se second using namespace std; using cd = complex <double>; typedef pair <int, int> pii; const long long Inf = 2e18; const long long mod = 1e9 + 7; const double Pi = acos(-1); void Fastio() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); } int n, cnt; int a[155], cntt[155]; int main() { // Fastio(); cin >> n; a[1] = 1; cntt[1] = 1; cnt = 1; for(int i = 2; i <= n; i++) { int l = 1, r = i - 1; cout << i << ' '; for(int j = 1; j <= i; j++) { cout << j << ' '; } cout << endl; int x; cin >> x; if(x == cnt + 1) { a[i] = cnt + 1; cntt[i] = cntt[i - 1] + 1; cnt++; } else { cntt[i] = cntt[i - 1]; while(l < r) { int mid = (r + l) >> 1; cout << mid + 1 << ' '; for(int i = 1; i <= mid; i++) { cout << i << ' '; } cout << i << endl; int x; cin >> x; if(x == cntt[mid]) { r = mid; } else { l = mid + 1; } } a[i] = a[l]; } } cout << 0 << ' '; for(int i = 1; i <= n; i++) { cout << a[i] << ' '; } cout << endl; }
#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...