# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
893823 | 1bin | Art Collections (BOI22_art) | C++17 | 1187 ms | 1636 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>
#include "art.h"
using namespace std;
#define all(v) v.begin(), v.end()
typedef long long ll;
int n, x, b;
/*
int publish(vector<int> v){
for(int& x : v) cout << x << ' ';
cout << endl;
int ret;
cin >> ret;
return ret;
}
void answer(vector<int> v){
for(int& x : v) cout << x << ' ';
cout << endl;
return;
}
*/
void solve(int n) {
vector<int> v, ans(n);
for(int i = 1; i <= n; i++) v.emplace_back(i);
b = publish(v);
for(int i = 1; i < n; i++){
for(int j = 0; j < n; j++)
v[j] = v[j] == n ? 1 : v[j] + 1;
x = publish(v);
ans[(n - 1 - x + b) / 2] = i;
b = x;
}
for(int i = 0; i < n; i++)
if(!ans[i]) ans[i] = n;
answer(ans);
}
/*
int main(void){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n;
cin >> n;
solve(n);
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |