Submission #722053

#TimeUsernameProblemLanguageResultExecution timeMemory
722053Mr_HusanboyArt Collections (BOI22_art)C++17
100 / 100
1458 ms724 KiB
#include "art.h" #include<bits/stdc++.h> #define all(a) (a).begin(), (a).end() template<typename T> int len(T &a){ return a.size(); } using namespace std; mt19937 mt(time(NULL)); void solve(int n){ vector<int> v(n); iota(all(v), 1); vector<int> memo(n); for(int i = 0; i < n; i ++){ memo[i] = publish(v); rotate(v.begin(), v.begin() + 1, v.end()); } vector<int> ans(n); for(int i = 0; i < n; i ++){ ans[(memo[i] + n - memo[(i + 1) % n] - 1) / 2] = 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...