답안 #703625

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
703625 2023-02-27T21:27:59 Z Kipras Art Collections (BOI22_art) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "art.h"

typedef long long ll;

using namespace std;

int solve(int n){

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

    //get all the offsets
    for(int i = 0; i < n; i++){
        vector<ll> 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);
    }

    return result;


}

Compilation message

art.cpp:8:5: error: ambiguating new declaration of 'int solve(int)'
    8 | int solve(int n){
      |     ^~~~~
In file included from art.cpp:2:
art.h:17:6: note: old declaration 'void solve(int)'
   17 | void solve(int N);
      |      ^~~~~
art.cpp: In function 'int solve(int)':
art.cpp:19:35: error: could not convert 'temp' from 'vector<long long int>' to 'vector<int>'
   19 |         offsets.push_back(publish(temp));
      |                                   ^~~~
      |                                   |
      |                                   vector<long long int>
art.cpp:36:12: error: cannot convert 'std::vector<int>' to 'int' in return
   36 |     return result;
      |            ^~~~~~
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) {
      |        ~~~~~~~~~^~~~