Submission #1119421

#TimeUsernameProblemLanguageResultExecution timeMemory
1119421thelegendary08Art Collections (BOI22_art)C++17
100 / 100
1340 ms1916 KiB
#include "art.h" #include<bits/stdc++.h> #define vi vector<int> #define pb push_back #define f0r(i,n) for(int i = 0; i < n; i++) using namespace std; void solve(int N) { std::vector<int> order = {1, 2, 3}; vi v; f0r(i, N){ vi quer; for(int j = i; j < N; j++){ quer.pb(j+1); } f0r(j, i){ quer.pb(j+1); } int x = publish(quer); v.pb(x); } v.pb(v[0]); vi ord(N); f0r(i, N){ ord[i] = (N-1 - (v[i+1] - v[i]))/2; } /* f0r(i, N){ cout<<ord[i]<<' '; } cout<<'\n'; */ vi ans(N); f0r(i,N){ ans[ord[i]] = 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...