Submission #1046502

#TimeUsernameProblemLanguageResultExecution timeMemory
1046502vjudge1Art Collections (BOI22_art)C++17
Compilation error
0 ms0 KiB
#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.push_back(i); int ans[n+1]; for(int i = 0;i<n;i++){ ans[i] = publish(v); v.push_back(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 (stderr)

art.cpp: In function 'void solve(long long int)':
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: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) {
      |        ~~~~~~~~~^~~~