Submission #906042

#TimeUsernameProblemLanguageResultExecution timeMemory
906042RaulAndrei01Art Collections (BOI22_art)C++17
70 / 100
1140 ms1724 KiB
#include "art.h" #include<iostream> using namespace std; void solve(int n) { vector<int> ans(n); for (int i = 1; i <= n; i++) { vector<int> use(n); use[0] = i; for (int j = 2; j <= n; j++) { if (j <= i) use[j-1] = j-1; else use[j-1] = j; } int d1 = publish(use); use[n-1] = i; for (int j = 1; j < n; j++) { if (j < i) use[j-1] = j; else use[j-1] = j+1; } int d2 = publish(use); // cout << d1 << ' ' << d2 << '\n'; // cout << (d1-d2+n-1)/2 << '\n'; ans[(d1-d2+n-1)/2] = i; } answer(ans); }

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