Submission #924561

#TimeUsernameProblemLanguageResultExecution timeMemory
924561mdobricArt Collections (BOI22_art)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int red[4005], red_in[4005]; vector <int> r; void answer (vector <int> v);/*{ for (int i = 0; i < v.size(); i++){ cout << v[i] << " "; } cout << "\n"; return; }*/ int publish (vector <int> v);/*{ cout << "? "; for (int i = 0; i < v.size(); i++){ cout << v[i] << " "; } cout << endl; int ans; cin >> ans; return ans; }*/ void solve (int n){ for (int i = 1; i <= n; i++){ for (int j = 1; j <= n; j++){ if (j != i){ r.push_back(j); } } r.push_back(i); int x = publish(r); r.clear(); r.push_back(i); for (int j = 1; j <= n; j++){ if (j != i){ r.push_back(j); } } int y = publish(r); r.clear(); red[i] = (n - 1 - x + y) / 2; red[i]++; red_in[red[i]] = i; } for (int i = 1; i <= n; i++){ r.push_back(red_in[i]); } answer(r); } int main (void){ return 0; }

Compilation message (stderr)

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/ccQ6i6xQ.o: in function `main':
interface.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccEaZKCO.o:art.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status