# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
916351 | Vladth11 | Carnival (CEOI14_carnival) | C++14 | 5 ms | 600 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define debug(x) cerr << #x << " " << x << "\n"
#define debugs(x) cerr << #x << " " << x << " "
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long ll;
typedef pair <ll, ll> pii;
const ll NMAX = 151;
const ll INF = (1LL << 60);
const ll nrbits = 20;
const ll MOD = 998244353;
const ll bucket = 320;
const double eps = 0.00000001;
int v[NMAX];
int top[NMAX];
vector <int> noi;
bool OK(int r, int i){
cout << r + 2 << " ";
for(int i = 0; i <= r; i++){
cout << noi[i] << " ";
}
cout << i << endl;
int rez;
cin >> rez;
if(rez == r + 2){
return 1;
}
return 0;
}
signed main() {
#ifdef HOME
// ifstream cin(".in");
// ofstream cout(".out");
#endif // HOME
int n, i;
cin >> n;
for(i = 1; i <= n; i++){
cout << noi.size() + 1 << " ";
for(auto x : noi){
cout << x << " ";
}
cout << i << endl;
int rez = 0;
cin >> rez;
if(rez == ((int)noi.size() + 1)){
noi.push_back(i);
top[i] = noi.size();
}
}
for(i = 1; i <= n; i++){
if(top[i]) continue;
int r = -1, pas = (1 << 7);
while(pas){
if(r + pas < noi.size() && OK(r + pas, i)){
r += pas;
}
pas /= 2;
}
r++;
top[i] = top[noi[r]];
}
cout << 0 << " ";
for(i = 1; i <= n; i++){
cout << top[i] << " ";
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |