Submission #995885

#TimeUsernameProblemLanguageResultExecution timeMemory
995885vjudge1Carnival (CEOI14_carnival)C++17
0 / 100
10 ms344 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<long long, long long> #define pb push_back #define F first #define S second #define all(x) (x).begin(), (x).end() const ll N = 2e5 + 100; const ll inf = 1e18; const ll mod = 1e9 + 7; const ll block = 500; const ll base = 31; ll n; ll p[N], a[N]; void to_nho_cau(){ cin >> n; ll d = 1; a[1] = 1; for(int i = 2; i <= n;i++){ ll l = 1, r = i - 1, res = -1; while(l <= r){ ll mid = (l + r) / 2; cout << i - mid + 1 << ' '; for(int j = mid; j <= i;j++) cout << j << ' '; cout << endl; ll x; cin >> x; cout << i - mid << ' '; for(int j = mid; j <= i - 1;j++) cout << j << ' '; cout << endl; ll y; cin >> y; if(x == y){ res = mid; l = mid + 1; } else r = mid - 1; } if(res == -1) a[i] = ++d; else a[i] = a[res]; } for(int i = 1; i <= n;i++) cout << a[i] << ' '; } signed main() { ios_base::sync_with_stdio(0); cin.tie(0); int t = 1; //cin >> t; while(t--) to_nho_cau(); 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...