Submission #1046501

# Submission time Handle Problem Language Result Execution time Memory
1046501 2024-08-06T15:54:34 Z vjudge1 Art Collections (BOI22_art) C++17
Compilation error
0 ms 0 KB
#include "art.h"
#include <bits/stdc++.h>

using namespace std;

#define ar array
#define int long long
#define ld long double

void solve(int n) {
    vector<int> v;
    for(int i = 1;i<=n;i++)v.pb(i);

    int ans[n+1];
    for(int i = 0;i<n;i++){
        ans[i] = publish(v);
        v.pb(v[0]);
        v.erase(v.begin());
    }
    ans[n] = ans[0];
    for(int i = 0;i<n;i++){
        int x = ans[i] - (ans[i] + ans[i+1] - n + 1) / 2;
        v[x] = i + 1;
    }

    answer(v);
}

Compilation message

art.cpp: In function 'void solve(long long int)':
art.cpp:12:30: error: 'class std::vector<long long int>' has no member named 'pb'
   12 |     for(int i = 1;i<=n;i++)v.pb(i);
      |                              ^~
art.cpp:16:26: error: could not convert 'v' from 'vector<long long int>' to 'vector<int>'
   16 |         ans[i] = publish(v);
      |                          ^
      |                          |
      |                          vector<long long int>
art.cpp:17:11: error: 'class std::vector<long long int>' has no member named 'pb'
   17 |         v.pb(v[0]);
      |           ^~
art.cpp:26:12: error: could not convert 'v' from 'vector<long long int>' to 'vector<int>'
   26 |     answer(v);
      |            ^
      |            |
      |            vector<long long int>
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) {
      |        ~~~~~~~~~^~~~