Submission #637046

# Submission time Handle Problem Language Result Execution time Memory
637046 2022-08-31T10:53:22 Z GrandTiger1729 Art Collections (BOI22_art) C++17
Compilation error
0 ms 0 KB
#include <iostream>
#include <vector>
#include <numeric>
using namespace std;

void solve(int n){
    vector<int> ans;
    iota(ans.begin(), ans.end(), 1);
    int i = 1, cur = publish(ans);
    while (cur > 0){
        vector<int> tmp(ans);
        tmp.erase(tmp.begin() + i);
        tmp.insert(tmp.begin(), ans[i]);
        int re = publish(tmp);
        int x = (re - cur + i) / 2;
        ans.erase(ans.begin() + i);
        ans.insert(ans.begin() + x, tmp[0]);
    }
    answer(ans);
}

Compilation message

art.cpp: In function 'void solve(int)':
art.cpp:9:22: error: 'publish' was not declared in this scope
    9 |     int i = 1, cur = publish(ans);
      |                      ^~~~~~~
art.cpp:19:5: error: 'answer' was not declared in this scope
   19 |     answer(ans);
      |     ^~~~~~
interface.cpp: In function 'int publish(std::vector<int>)':
interface.cpp:20:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~
interface.cpp: In function 'void answer(std::vector<int>)':
interface.cpp:36:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   36 |     if(v.size() != N) {
      |        ~~~~~~~~~^~~~