Submission #599084

#TimeUsernameProblemLanguageResultExecution timeMemory
599084alextodoranArt Collections (BOI22_art)C++17
100 / 100
1643 ms620 KiB
/**
 ____ ____ ____ ____ ____
||a |||t |||o |||d |||o ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|

**/

#include <bits/stdc++.h>
#include "art.h"

using namespace std;

typedef long long ll;

int publish (vector <int> R);
void answer (vector <int> R);

void solve (int N) {
    vector <int> R(N);
    iota(R.begin(), R.end(), 1);
    int old = publish(R);
    vector <int> sol(N, N);
    for (int i = 2; i <= N; i++) {
        R.push_back(R.front());
        reverse(R.begin(), R.end());
        R.pop_back();
        reverse(R.begin(), R.end());
        int now = publish(R);
        sol[(old - now + (N - 1)) / 2] = R.back();
        old = now;
    }
    answer(sol);
}

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