Submission #993646

#TimeUsernameProblemLanguageResultExecution timeMemory
993646yellowtoadArt Collections (BOI22_art)C++17
100 / 100
1156 ms1636 KiB
#include "art.h" #include <iostream> #include <vector> using namespace std; void solve(int n) { vector<int> a(n); for (int i = 0; i < n; i++) a[i] = i+1; int cur = publish(a); for (int i = 1; i < n; i++) { for (int j = i-1; j >= 0; j--) a[j+1] = a[j]; a[0] = i+1; int x = publish(a); for (int j = 0; j < (i+x-cur)/2; j++) a[j] = a[j+1]; a[(i+x-cur)/2] = i+1; cur = x-(i+x-cur)/2; } answer(a); }

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