Submission #600109

#TimeUsernameProblemLanguageResultExecution timeMemory
600109TimDeeArt Collections (BOI22_art)C++17
100 / 100
1611 ms712 KiB
#include "art.h" #include <bits/stdc++.h> using namespace std; using ll = long long; void solve (int n) { deque<int> a; for (int i=1; i<=n; ++i) a.push_back(i); vector<int> b(a.begin(), a.end()); int x=publish(b); vector<int> ans(n,n); for (int i=1; i<n; ++i) { a.pop_front(); a.push_back(i); vector<int> b(a.begin(), a.end()); int y=publish(b); int z=y-x; x=y; int ind=(n-1-z)/2; //cout<<x<<' '<<y<<' '<<ind<<'\n'; ans[ind]=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...