Submission #930932

#TimeUsernameProblemLanguageResultExecution timeMemory
930932AlebnArt Collections (BOI22_art)C++17
70 / 100
1109 ms1696 KiB
#include <bits/stdc++.h>
#include "art.h"

using namespace std;

void solve(int n) {
    int x, y, temp;
    vector<int> a(n), res(n);
    for(int i = 0; i < n; i++) a[i] = i + 1;
    y = publish(a);
    for(int i = 0; i < n; i++) {
        x = y;
        //cyclc shift
        temp = a[n - 1];
        for(int i = n - 1; i > 0; i--) a[i] = a[i - 1];
        a[0] = temp;
        //
        y = publish(a);
        res[(y - x + n - 1) / 2] = temp;
    }
    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...