Submission #1368084

#TimeUsernameProblemLanguageResultExecution timeMemory
1368084nataliaaArt Collections (BOI22_art)C++20
Compilation error
0 ms0 KiB
// #include "art.h"
#include<bits/stdc++.h>
using namespace std;

void solve(int n) {
    vector<int> v;
    for(int i = 1;i<=n; i++) v.push_back(i);
    pair<int, int> p[n];
    for(int i = 0; i < n; i++){
        int k = publish(v);
        p[v[0]-1].first = k;
        p[v[n-1]-1].second = k;
        int l = v[0];
        for(int j = 0; j < n-1; j++) v[j] = v[j+1];
        v[n-1]=l;
    }
    vector<int> ans(n);
    for(int i = 0; i < n; i++){
        int x = p[i].first;
        int y = p[i].second;
        int z = y - x;
        y = n - 1 - z;
        z = y/2;
        ans[z] = i+1; 
    }
    answer(ans);
}

Compilation message (stderr)

art.cpp: In function 'void solve(int)':
art.cpp:10:17: error: 'publish' was not declared in this scope
   10 |         int k = publish(v);
      |                 ^~~~~~~
art.cpp:26:5: error: 'answer' was not declared in this scope
   26 |     answer(ans);
      |     ^~~~~~