Submission #589465

#TimeUsernameProblemLanguageResultExecution timeMemory
589465gromperenArt Collections (BOI22_art)C++17
100 / 100
1511 ms668 KiB
#include <bits/stdc++.h> using namespace std; #include "art.h" // g++ -std=c++17 art_sample.cpp sample_grader.cpp // void solve(int n) { vector<int> a(n); for (int i = 0; i < n; ++i) a[i] = i+1; vector<int> ans(n+1); for (int i = 0; i<n; ++i) { ans[i] = publish(a); rotate(a.begin(), a.begin()+1, a.end()); } ans[n] = ans[0]; vector<int> out(n); for (int i = 0; i < n; ++i) { int q = ans[i] - ans[i+1] + n-1; out[q / 2] = i + 1; } answer(out); }

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