Submission #1092853

#TimeUsernameProblemLanguageResultExecution timeMemory
1092853irmuunArt Collections (BOI22_art)C++17
100 / 100
1257 ms1580 KiB
#include <bits/stdc++.h> #include "art.h" using namespace std; #define ll long long #define pb push_back #define ff first #define ss second #define all(s) s.begin(),s.end() #define rall(s) s.rbegin(),s.rend() void solve(int N){ vector<int>R(N); vector<int>ans(N); vector<int>cnt(N+5,0); iota(all(R),1); for(int i=1;i<=N;i++){ cnt[i]=publish(R); rotate(R.begin(),R.begin()+1,R.end()); } for(int i=1;i<=N;i++){ int nxt=i+1; if(nxt>N) nxt=1; int A=cnt[i],B=cnt[nxt]; for(int x=0;x<N;x++){ int y=(N-1)-x; if(x-y==A-B){ ans[x]=i; break; } } } answer(ans); return; }

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...