Submission #1113597

#TimeUsernameProblemLanguageResultExecution timeMemory
1113597minggaCarnival (CEOI14_carnival)C++17
100 / 100
47 ms700 KiB
#include "bits/stdc++.h" using namespace std; #define ln "\n" #define pb push_back #define fi first #define se second #define all(x) (x).begin(), (x).end() #define sz(x) ((int)(x).size()) #define int long long const int MOD = 1e9 + 7; const int inf = 2e18; signed main() { cin.tie(0) -> sync_with_stdio(0); int n; cin >> n; int C = 0; cout << n << ' '; for(int i = 1; i <= n; i++) cout << i << ' '; cout << endl; cin >> C; vector<int> cur; vector<int> nxt; vector<int> ans(n + 1, 0); for(int i = 1; i <= n; i++) { int c; if(i != n) { cout << n - i << ' '; for(int j = i + 1; j <= n; j++) cout << j << ' '; cout << endl; cin >> c; } else { c = 0; } if(c < C) { ans[i] = C; for(int x : cur) { cout << 2 << ' ' << i << ' ' << x << endl; int y; cin >> y; if(y != 1) { nxt.pb(x); } else { ans[x] = C; } } swap(cur, nxt); vector<int>(0).swap(nxt); C--; } else cur.pb(i); } cout << 0 << ' '; for(int i = 1; i <= n; i++) cout << ans[i] << ' '; cout << endl; cerr << "\nTime: " << clock() * 1000 / CLOCKS_PER_SEC; }
#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...