Submission #716094

#TimeUsernameProblemLanguageResultExecution timeMemory
716094Sandarach151Art Collections (BOI22_art)C++17
100 / 100
1628 ms672 KiB
#include<bits/stdc++.h> #include<art.h> using namespace std; void solve(int n){ vector<int> vect; for(int i=1; i<=n; i++){ vect.push_back(i); } int temp = publish(vect); swap(vect[0], vect[1]); int temp2 = publish(vect); if(temp<temp2){ swap(vect[0], vect[1]); } temp = min(temp, temp2); for(int i=2; i<n; i++){ swap(vect[i], vect[0]); int temp2 = publish(vect); int cur = temp2-temp; int pos = (cur+1)/2; swap(vect[i], vect[0]); for(int j=i; j>pos; j--){ swap(vect[j], vect[j-1]); } temp-=i-pos; } answer(vect); }

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