# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
877739 | vjudge1 | Art Collections (BOI22_art) | C++17 | 0 ms | 0 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 "art.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5;
const int mod = 1e9+7;
const int logn=30;
void solve(int N) {
vector<int>v;
for(int i=0;i<n;i++)
{
int x;
cin>>x;
v.push_back(x);
}
for(int i=1;i<=n;i+=2)
{
int x=i;
int y=i+1;
vector<int>a;
vector<int>b;
a=v;
b=a;
int pos1;
int pos2;
for(int j=0;j<v.size();j++)
{
if(v[j]==x)
{
pos1=j;
}
if(v[j]==y)
{
pos2=j;
}
}
swap(b[pos1],b[pos2]);
int k1=publish(a);
int k2=publish(b);
if(k1<=k2)
{
v=a;
}
else
{
v=b;
}
}
answer(v);
///publish(order);
///answer(order);
}