Submission #587100

#TimeUsernameProblemLanguageResultExecution timeMemory
587100CyanmondArt Collections (BOI22_art)C++17
100 / 100
1573 ms912 KiB
#include "art.h" #include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; #define ALL(x) (x).begin(), (x).end() #define REP_3(i, l, r) for (int i = (l); i < (r); ++i) #define RVP_3(i, l, r) for (int i = (r - 1); i >= (l); --i) #define REP(i, N) REP_3(i, 0, N) #define RVP(i, N) RVP_3(i, 0, N) int Publish(vector<int> v) { for (auto &e : v) ++e; return publish(v); } void Answer(vector<int> v) { for (auto &e : v) ++e; answer(v); exit(0); } void solve(int N) { vector<int> order(N); iota(ALL(order), 0); vector<int> result(N); REP(i, N) { result[i] = Publish(order); rotate(order.begin(), order.begin() + 1, order.end()); } result.push_back(result[0]); vector<int> ans(N); REP(i, N) ans[((result[i] - result[i + 1]) + N - 1) / 2] = i; 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...