Submission #720910

#TimeUsernameProblemLanguageResultExecution timeMemory
720910YENGOYANArt Collections (BOI22_art)C++17
0 / 100
0 ms208 KiB
#include "art.h" #include <vector> #include <algorithm> #include <cmath> using namespace std; void solve(int N) { // std::vector<int> order = {1, 2, 3}; // publish(order); // order = {2, 3, 1}; // publish(order); // order = {1, 3, 2}; // answer(order); int n = N; vector<int> v(n); for(int i = 0; i < n; ++i){ v[i] = i + 1; } int l1 = publish(v), c = n+1; vector<int> ans(n); for(int i = 0; i < n - 1; ++i){ v.insert(v.begin(), v.back()); v.pop_back(); int l2 = publish(v); ans[(l2 - l1 + n - 1) / 2] = --c; l1 = l2; } reverse(ans.begin(), ans.end()); for(int i = 0; i < n; ++i){ if(!ans[i]) { ans[i] = 1; } } 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...