Submission #1121247

#TimeUsernameProblemLanguageResultExecution timeMemory
1121247vjudge1Art Collections (BOI22_art)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "art.h" using namespace std; vector <int> v; vector <int> ans(4444); // int publish(vector <int> v) { // cout << "publish({"; // int x; // for(auto to : v) cout << to << " "; // cout << "})" << endl; // cin >> x; // return x; // } // void answer(vector <int> v) { // cout << "answer({"; // for(auto to : v) {if(to != 0) cout << to << " ";} // cout << "})" << endl; // } void solve() { int n; cin >> n; vector <int> v, v2; for(int i = 1; i <= n; i++) { v.push_back(i); } int res = publish(v); if(res == 0) { answer(v); return; } v.clear(); int ind = 1; //cout << res << '\n'; for(int i = 1; i < n; i++) { vector <int> v2; //cout << i << endl; for(int j = i + 1; j <= n; j++) { v2.push_back(j); } for(int j = 1; j <= i; j++) { v2.push_back(j); } int cur = publish(v2); int A = res, B = cur; int d = (A + B - n + 1) / 2; ans[A - d + 1] = i; //cout << i << " " << A << " " << B << " " << d << " " << A - d + 1 << " " << endl; v = v2; res = cur; } for(int i = 1; i < n; i++) { if(ans[i] == 0) ans[i] = n; } answer(ans); } // signed main() { // solve(); // }

Compilation message (stderr)

art.cpp: In function 'void solve()':
art.cpp:32:6: warning: unused variable 'ind' [-Wunused-variable]
   32 |  int ind = 1;
      |      ^~~
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) {
      |        ~~~~~~~~~^~~~
/usr/bin/ld: /tmp/ccedxn33.o: in function `main':
interface.cpp:(.text.startup+0x16): undefined reference to `solve(int)'
collect2: error: ld returned 1 exit status