Submission #689732

#TimeUsernameProblemLanguageResultExecution timeMemory
689732bdlArt Collections (BOI22_art)C++17
100 / 100
1903 ms588 KiB
#pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include "art.h" #include <algorithm> #include <vector> using namespace std; void solve(int n) { vector<int> p(n); for (int i = 0; i < n; i++) p[i] = i + 1; vector<int> k(n); for (int i = 0; i < n; i++) { k[i] = publish(p); rotate(p.begin(), p.begin() + 1, p.end()); } for (int i = 0; i < n; i++) p[(k[i] - k[(i + 1) % n] + n - 1) / 2] = i + 1; answer(p); }

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