Submission #1264950

#TimeUsernameProblemLanguageResultExecution timeMemory
1264950minggaArt Collections (BOI22_art)C++20
Compilation error
0 ms0 KiB
// Author: caption_mingle
#include "bits/stdc++.h"
// #include "art.h"

using namespace std;

#define ln "\n"
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define ll long long
const int mod = 1e9 + 7;
const int inf = 2e9;


void solve(int N) {
	vector<int> vec;
	for(int i = 1; i <= N; i++) vec.pb(i);
	vector<int> f(N, 0);
	for(int i = 0; i < N; i++) {
		f[i] = publish(vec);
		for(int j = 0; j < N - 1; j++) {
			swap(vec[j], vec[j + 1]);
		}
	}
	vector<int> ans(N);
	for(int i = 0; i < N; i++) {
		int j = (i + 1) % N;
		ans[(f[j] - f[i] + N - 1) / 2 + 1] = i + 1;
	}
	answer(ans);
}

Compilation message (stderr)

art.cpp: In function 'void solve(int)':
art.cpp:23:24: error: 'publish' was not declared in this scope
   23 |                 f[i] = publish(vec);
      |                        ^~~~~~~
art.cpp:33:9: error: 'answer' was not declared in this scope
   33 |         answer(ans);
      |         ^~~~~~