Submission #882851

#TimeUsernameProblemLanguageResultExecution timeMemory
882851AlphaMale06Art Collections (BOI22_art)C++17
100 / 100
1141 ms2000 KiB
#include<bits/stdc++.h> using namespace std; #include "art.h" void solve(int n){ vector<int> ans(n); vector<int> p(n); for(int i=0; i<n; i++)p[i]=i+1; int qry[n]; for(int i=0; i< n; i++){ qry[i]=publish(p); rotate(p.begin(), p.begin()+1, p.end()); } for(int i=0; i< n; i++){ int x=qry[i]; int y=qry[(i+1)%n]; ans[(x-y+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...