Submission #1235526

#TimeUsernameProblemLanguageResultExecution timeMemory
1235526SG2AlokArt Collections (BOI22_art)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
typedef long long ll;
using namespace __gnu_pbds;
#define endl '\n'
#define hitaf ios_base::sync_with_stdio(false); cin.tie(0);
#define fi first
#define se second
 
template <typename T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag, tree_order_statistics_node_update>;
 
const ll MOD = 1e9 + 7;
const ll MOD1 = 998244353;
const ll INF = 4500000000000000000LL;
const ll INF1 = 1e18;
const ll mod1 = 6900000469;
const ll mod2 = 698000002369;
const int block = 160;

ll n, m, k, q, a[1200005], b[500005], c[500005];
string s, s1, s2;

int main() {
//    hitaf
	int T = 1;
//	cin >> T;
	
	while(T--){
		cin >> n;
		
		vector<ll> nums, sum;
		for(int i = 1; i <= n; i++) nums.push_back(i);
		
		ll judges = publish(nums);
		sum.push_back(judges);
		for(int i = 2; i <= n; i++){
			for(int i = 0; i < n - 1; i++) swap(nums[i], nums[i + 1]);
			judges = publish(nums);
			sum.push_back(judges);
		}
		
		vector<ll> ans(n);
		sum.push_back(sum[0]);
		for(int i = 0; i < n; i++){
			ll idx = (-sum[i + 1] + sum[i] + n + 1) / 2 - 1;
			ans[idx] = i + 1;
		}
		
		answer(ans);
	}
}

/*


	8 3 4 2 1 5 7 6
	1 5 6 7 2 4 3 8
	
*/

Compilation message (stderr)

art.cpp: In function 'int main()':
art.cpp:36:29: error: 'publish' was not declared in this scope
   36 |                 ll judges = publish(nums);
      |                             ^~~~~~~
art.cpp:51:17: error: 'answer' was not declared in this scope
   51 |                 answer(ans);
      |                 ^~~~~~