Submission #703626

# Submission time Handle Problem Language Result Execution time Memory
703626 2023-02-27T21:28:55 Z Kipras Art Collections (BOI22_art) C++17
0 / 100
1 ms 208 KB
#include <bits/stdc++.h>
#include "art.h"

typedef long long ll;

using namespace std;

void solve(int n){

    vector<ll> actual;
    vector<ll> offsets;

    //get all the offsets
    for(int i = 0; i < n; i++){
        vector<int> temp;
        for(int x = 0; x < n; x++){
            temp.push_back((i+x)%n);
        }
        offsets.push_back(publish(temp));
    }

    for(int i = 0; i < n; i++){
        ll y = (offsets[i]+offsets[(i+1)%n]-2*n+2)/2;
        ll number = n-(offsets[i]-y);
        actual.push_back(number);
    }

    reverse(actual.begin(), actual.end());

    vector<int> result;

    for(auto i : actual){
        result.push_back(i);
    }

    answer(result);


}

Compilation message

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 time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -