Submission #938712

#TimeUsernameProblemLanguageResultExecution timeMemory
938712XiaoyangArt Collections (BOI22_art)C++17
100 / 100
1217 ms1776 KiB
#include "art.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; #define fi first #define se second #define pll pair<ll,ll> #define pb push_back #define debug(x) cerr<<#x<<"="<<x<<endl; #define MP make_pair #define rep(i,a,b) for(ll i=a;i<b;i++) #define ALL(x) x.begin(),x.end() #define endl "\n" const ll inf=1e18; void solve(int n) { vector<int>a(n),ans(n); rep(i,0,n)a[i]=i+1; ll curr=0,prev=0,init=0; curr=publish(a); init=curr; rep(i,0,n){ prev=curr; ll tmp=a[n-1]; for(ll j=n-1;j>0;j--)a[j]=a[j-1]; a[0]=tmp; if(i==n-1)curr=init; else curr=publish(a); ans[(curr-prev+n-1)/2]=tmp; } 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...