| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1335972 | trandaihao5555 | Art Collections (BOI22_art) | C++20 | 680 ms | 508 KiB |
#include "art.h"
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
#define pb push_back
void solve(int N) {
vi a;
for(int i=1;i<=N;i++) a.pb(i);
int fa = publish(a);
vi res(N,0);
for(int i=1;i<N;i++) {
vi b;
for(int j=1;j<i;j++) b.pb(j);
for(int j=i+1;j<=N;j++) b.pb(j);
b.pb(i);
int fb = publish(b);
int rank_i = ((fa - fb) + (N - i)) / 2 + 1;
for (int j=0,k = 0;j<N;j++) {
if (res[j] == 0) k++;
if (k == rank_i) {
res[j] = i;
break;
}
}
}
for(int i=0;i<N;i++) if (!res[i]) res[i] = N;
answer(res);
}
| # | 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... | ||||
