Submission #723458

# Submission time Handle Problem Language Result Execution time Memory
723458 2023-04-13T20:36:39 Z Charizard2021 Art Collections (BOI22_art) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
void solve(int n) {
    vector<int> responses;
    for(int i = 0; i < n; ++i) {
        vector<int> order(n);
        for(int j = 0; j < n; ++j)
            order[j] = (j + i) % n + 1;

        responses.push_back(publish(order));
    }
    vector<int> final_order(n);
    for(int i = 0; i < n; ++i) {
        final_order[(responses[i]-responses[(i + 1) % n] + n - 1) / 2] = i + 1;
    }
    answer(final_order);
}

Compilation message

art.cpp: In function 'void solve(int)':
art.cpp:10:29: error: 'publish' was not declared in this scope
   10 |         responses.push_back(publish(order));
      |                             ^~~~~~~
art.cpp:16:5: error: 'answer' was not declared in this scope
   16 |     answer(final_order);
      |     ^~~~~~
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) {
      |        ~~~~~~~~~^~~~