Submission #1121215

#TimeUsernameProblemLanguageResultExecution timeMemory
1121215vjudge1Art Collections (BOI22_art)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "art.h"

using namespace std;

void solve(int n) {
    deque<int> a;
    
    for(int i=1 ; i <= n ; i++)
        a.push_back(i);
    int ls=publish(a);
    deque<int> ans;
    for(int i=1 ; i < n ; i++){
        int x=a.back();
        a.pop_back();
        a.push_front(x);
        int nw=publish(a);
        a+b=n-1
        a-b=ls-nw
        2a=n-1+ls-nw
        ans.pb((ls-nw+n-1)/2);
    }
    ans.pb(a[0]);
    answer(ans);
}

Compilation message (stderr)

art.cpp: In function 'void solve(int)':
art.cpp:11:20: error: could not convert 'a' from 'std::deque<int>' to 'std::vector<int>'
   11 |     int ls=publish(a);
      |                    ^
      |                    |
      |                    std::deque<int>
art.cpp:17:24: error: could not convert 'a' from 'std::deque<int>' to 'std::vector<int>'
   17 |         int nw=publish(a);
      |                        ^
      |                        |
      |                        std::deque<int>
art.cpp:18:11: error: 'b' was not declared in this scope
   18 |         a+b=n-1
      |           ^
art.cpp:17:13: warning: unused variable 'nw' [-Wunused-variable]
   17 |         int nw=publish(a);
      |             ^~
art.cpp:23:9: error: 'class std::deque<int>' has no member named 'pb'
   23 |     ans.pb(a[0]);
      |         ^~
art.cpp:24:12: error: could not convert 'ans' from 'std::deque<int>' to 'std::vector<int>'
   24 |     answer(ans);
      |            ^~~
      |            |
      |            std::deque<int>
art.cpp:11:9: warning: unused variable 'ls' [-Wunused-variable]
   11 |     int ls=publish(a);
      |         ^~
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) {
      |        ~~~~~~~~~^~~~