Submission #939474

#TimeUsernameProblemLanguageResultExecution timeMemory
939474HanksburgerArt Collections (BOI22_art)C++17
100 / 100
1188 ms1604 KiB
#include "art.h" #include <bits/stdc++.h> using namespace std; void solve(int n) { vector<int> vec, tmp; for (int i=1; i<=n; i++) tmp.push_back(i); int cur=publish(tmp); vec.push_back(1); for (int i=2; i<=n; i++) { tmp.clear(); tmp.push_back(i); for (int j:vec) tmp.push_back(j); for (int j=i+1; j<=n; j++) tmp.push_back(j); int ind=(publish(tmp)+i-1-cur)/2; vec.insert(vec.begin()+ind, i); cur-=i-1-ind; } answer(vec); }

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