Submission #580875

#TimeUsernameProblemLanguageResultExecution timeMemory
580875amunduzbaevArt Collections (BOI22_art)C++17
100 / 100
1661 ms584 KiB
#include "art.h" #include "bits/stdc++.h" using namespace std; #ifndef EVAL #include "sample_grader.cpp" #endif #define ar array void solve(int n){ vector<int> r(n); auto ask = [&](int in){ vector<int> a(n); for(int i=0;i<n;i++){ a[i] = (in + i) % n + 1; } return publish(a); }; for(int i=0;i<n;i++){ r[i] = ask(i); } vector<int> pos(n), res(n); for(int i=0;i<n;i++){ pos[i] = (r[i] - r[(i + 1) % n] + n - 1) / 2; res[pos[i]] = i + 1; } //~ for(int i=0;i<n;i++) cout<<pos[i]<<" "; //~ cout<<"\n"; answer(res); }

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