Submission #986795

#TimeUsernameProblemLanguageResultExecution timeMemory
986795alexddArt Collections (BOI22_art)C++17
100 / 100
1222 ms1760 KiB
#include "art.h" #include<bits/stdc++.h> using namespace std; int ans[4005]; void solve(int N) { vector<int> ord; for(int i=1;i<=N;i++) ord.push_back(i); ans[1] = publish(ord); for(int i=2;i<=N;i++) { vector<int> neword; neword.push_back(ord.back()); for(int j=0;j+1<ord.size();j++) neword.push_back(ord[j]); ord = neword; ans[i] = publish(ord); } vector<int> rez; rez.resize(N); for(int i=N;i>1;i--) { int x = ans[N-i+1]; int y = ans[N-i+2]; int poz = (y-x+N+1)/2; rez[poz-1] = i; } for(int i=0;i<N;i++) if(rez[i]==0) rez[i]=1; answer(rez); }

Compilation message (stderr)

art.cpp: In function 'void solve(int)':
art.cpp:15:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |         for(int j=0;j+1<ord.size();j++)
      |                     ~~~^~~~~~~~~~~
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...