# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
913802 | Ludissey | Art Collections (BOI22_art) | C++17 | 1275 ms | 1972 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;
vector<int> a;
int N;
void solve(int n) {
N=n;
a.resize(N);
for (int i = 0; i < N; i++) a[i]=i+1;
vector<int> score(N);
vector<int> order(N);
vector<pair<int,int>> sorter(N);
score[0]=publish(a);
for (int i = 1; i < N; i++)
{
a.erase(a.begin());
a.push_back(i);
score[i]=publish(a);
}
for (int i = 0; i < N; i++){
int scoredf=score[i];
if(i<N-1) scoredf-=score[i+1];
else scoredf-=score[0];
sorter[i]={scoredf,i+1};
}
sort(sorter.begin(),sorter.end());
for (int i = 0; i < N; i++) order[i]=sorter[i].second;
answer(order);
}
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... |