Submission #924562

#TimeUsernameProblemLanguageResultExecution timeMemory
924562mdobricArt Collections (BOI22_art)C++17
70 / 100
1203 ms1864 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) {
      |        ~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...