Submission #692087

#TimeUsernameProblemLanguageResultExecution timeMemory
692087AlexandruabcdeArt Collections (BOI22_art)C++17
100 / 100
1621 ms696 KiB
#include "art.h" #include <bits/stdc++.h> using namespace std; constexpr int NMAX = 4005; int val_spate[NMAX]; int poz[NMAX]; void solve(int N) { vector <int> V; for (int i = 1; i <= N; ++ i ) V.push_back(i); for (int i = N; i >= 1; -- i ) { val_spate[i] = publish(V); V.clear(); for (int j = i; j <= N; ++ j ) V.push_back(j); for (int j = 1; j < i; ++ j ) V.push_back(j); } val_spate[0] = val_spate[N]; for (int i = N; i >= 1; -- i ) { int spate = val_spate[i]; int fata = val_spate[i-1]; poz[i] = (fata - spate + N + 1) / 2; } V.clear(); V.resize(N); for (int i = 1; i <= N; ++ i ) V[poz[i]-1] = i; answer(V); }

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