# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
579616 | jasmin | Art Collections (BOI22_art) | C++17 | 1662 ms | 624 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;
/*int publish(vector<int>& p){
for(auto e: p){
cout << e << " ";
}
cout << "\n" << flush;
int ans;
cin >> ans;
return ans;
}*/
/*void answer(vector<int> p){
cout << "answer: ";
for(auto e: p){
cout << e << " ";
}
cout << "\n";
}*/
void solve(int n){
vector<int> p(n);
vector<pair<int,int> > ans(n);
for(int i=1; i<=n; i++){
p[n-1]=i; int ind=0;
for(int j=1; j<=n; j++){
if(j!=i){
p[ind]=j;
ind++;
}
}
int a=publish(p);
p[0]=i; ind=1;
for(int j=1; j<=n; j++){
if(j!=i){
p[ind]=j;
ind++;
}
}
int b=publish(p);
ans[i-1]={a-b, i};
}
sort(ans.begin(), ans.end());
reverse(ans.begin(), ans.end());
for(int i=0; i<n; i++){
p[i]=ans[i].second;
}
answer(p);
}
/*signed main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
solve(n);
}*/
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... |