Submission #653512

#TimeUsernameProblemLanguageResultExecution timeMemory
653512AlperenTArt Collections (BOI22_art)C++17
100 / 100
1656 ms792 KiB
#include <bits/stdc++.h> #include "art.h" using namespace std; void solve(int n) { vector<int> vec(n), ans(n, -1); iota(vec.begin(), vec.end(), 1); int prv, cur; prv = publish(vec); for(int i = 0; i < n - 1; i++){ vec.push_back(vec.front()); vec.erase(vec.begin()); cur = publish(vec); ans[n - 1 - ((cur - prv + (n - 1)) / 2)] = vec.back(); prv = cur; } for(int i = 0; i < n; i++) if(ans[i] == -1) ans[i] = vec.front(); 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...