| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 951440 | zordeno | Art Collections (BOI22_art) | C++17 | 87 ms | 344 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"
//#include "sample_grader.cpp"
using namespace std;
#define endl '\n'
#define ll long long
vector <int> dx = {1, 0, 0, -1, 0, 0};
vector <int> dy = {0, 1, 0, 0, -1, 0};
vector <int> dz = {0, 0, 1, 0, 0, -1};
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
const ll MAX = 2005, MOD = 1e9 + 7, INF = 1e18;
void solve(int n)
{
vector <int> vec(n);
for (int i = 0; i < n; i++)
{
vec[i] = i + 1;
}
int compbef = publish(vec);
int tmp2 = compbef;
if (compbef == 0)
{
answer(vec);
}
vector <int> v(n);
vector <int> tmp(n);
v[0] = 0;
for (int i = 1; i < n; i++)
{
tmp = vec;
for (int j = i; j > 0; j--)
{
swap(vec[j], vec[j - 1]);
int compaft = publish(vec);
if (compaft == 0)
{
answer(vec);
}
if (compaft < compbef)
{
v[i]++;
}
compbef = compaft;
}
vec = tmp;
compbef = tmp2;
}
for (int i = 0; i < n; i++)
{
rotate(vec.begin() + i - v[i] , vec.begin() + i, vec.begin() + i + 1);
}
answer(vec);
}
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... | ||||
