Submission #807692

#TimeUsernameProblemLanguageResultExecution timeMemory
807692JuanArt Collections (BOI22_art)C++17
0 / 100
1 ms208 KiB
#include<bits/stdc++.h> #include "art.h" using namespace std; int ask(int x, int n){ vector<int> v; v.push_back(x); for(int i = 1; i <= n; i++) if(i!=x) v.push_back(i); publish(v); int rt; cin >> rt; return rt; } void insrt(vector<int> &v, int x, int p){ vector<int> aux; for(int i = 0; i < p; i++) aux.push_back(v[i]); aux.push_back(x); for(int i = p; i < v.size(); i++) aux.push_back(v[i]); swap(v, aux); } void solve(int n){ vector<int> ans; int B = ask(1, n); ans.push_back(1); for(int i = 2; i <= n; i++){ // int x = ask(i); // int antes = (i-1-B+x)/2; // insrt(ans, i, antes); insrt(ans, i, (i-1-B+ask(i,n))/2); } answer(ans); }

Compilation message (stderr)

art.cpp: In function 'void insrt(std::vector<int>&, int, int)':
art.cpp:18:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |  for(int i = p; i < v.size(); i++) aux.push_back(v[i]);
      |                 ~~^~~~~~~~~~
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...