# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
827368 | vjudge1 | Art Collections (BOI22_art) | C++17 | 15 ms | 208 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<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include"art.h" // Don't forget to uncomment!
using namespace std;
typedef vector<int> vi;
/*
int publish(vector<int> R)
{
for(int& i : R)cout << i << ' ';cout << endl;// COMMENT OUT
int w;
cin >> w;
return w;
}
*/
/*
void answer(vector<int> R)
{
for(int& i : R)cout << i << ' ';cout << endl;
}
*/
void solve(int N)
{
vector<int> ans(N);
iota(ans.begin(), ans.end(), 1ll);
int w = publish(ans);
for(int i = 0; i < N; i++)
{
int icpy = i;
for(int j = 0; j < N; ++j)
{
if(j == i)continue;
swap(ans[i], ans[j]);
int new_w = publish(ans);
if(new_w == 0)
{
answer(ans);
//return; // maybe comment out? idk
}
if(new_w < w)
{
w = new_w;
i = j;
}
else swap(ans[i], ans[j]);
}
i = icpy;
}
answer(ans);
}
/*
int main()
{
solve(4);
}
*/
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... |