Submission #915224

#TimeUsernameProblemLanguageResultExecution timeMemory
915224PikachuArt Collections (BOI22_art)C++17
100 / 100
1228 ms1688 KiB
#include <bits/stdc++.h> using namespace std; int publish(vector<int>); void answer(vector<int>); void solve(int N) { vector<int> tmp; for (int i = 1; i <= N; i++) tmp.push_back(i); int cur = publish(tmp); vector<int> ans; ans.push_back(1); for (int i = 2; i <= N; i++) { tmp.clear(); tmp.push_back(i); tmp.insert(tmp.end(), ans.begin(), ans.end()); for (int j = i + 1; j <= N; j++) tmp.push_back(j); int ncur = publish(tmp); int delta = ncur - cur; int pos = (delta + i - 1) / 2; ans.insert(ans.begin() + pos, i); cur = ncur - pos; } answer(ans); }

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...