Submission #577637

#TimeUsernameProblemLanguageResultExecution timeMemory
577637vanicArt Collections (BOI22_art)C++17
100 / 100
1839 ms680 KiB
#include "art.h" #include <iostream> #include <algorithm> #include <vector> using namespace std; vector < int > niz; void solve(int n){ for(int i=1; i<=n; i++){ niz.push_back(i); } int tren=publish(niz); int x; int y; int val; for(int i=1; i<n; i++){ val=niz[i]; niz.erase(niz.begin()+i); niz.insert(niz.begin(), val); x=publish(niz); y=x-tren+i; y/=2; niz.erase(niz.begin()); niz.insert(niz.begin()+y, val); tren=x-y; } answer(niz); }

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