답안 #651635

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
651635 2022-10-19T13:27:22 Z inksamurai Art Collections (BOI22_art) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "art.h"
#define int ll
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define rng(i,c,n) for(int i=c;i<n;i++)
#define fi first
#define se second
#define pb push_back
#define sz(a) (int)a.size()
#define vec(...) vector<__VA_ARGS__>
#define _3CZAtRo ios::sync_with_stdio(0),cin.tie(0)
typedef long long ll;
using pii=pair<int,int>;
using vi=vector<int>;
void print(){cout<<'\n';}
template<class h,class...t>
void print(const h&v,const t&...u){cout<<v<<' ',print(u...);}

void solve(int N){
	int n=N;
	vi pns(n);
	rep(pvt,n){
		vi a;
		a.pb(pvt+1);
		rep(j,n){
			if(j==pvt) continue;
			a.pb(j+1);
		}
		ll u=publish(a);
		a.erase(a.begin());
		a.pb(pvt+1);
		ll v=publish(a);
		assert((u+v-n+1)%2==0);
		ll z=(u+v-n+1)/2;
		ll x=u-z;
		pns[x]=pvt+1;
	}
	answer(pns);
}

Compilation message

art.cpp: In function 'void solve(ll)':
art.cpp:31:16: error: could not convert 'a' from 'vector<long long int>' to 'vector<int>'
   31 |   ll u=publish(a);
      |                ^
      |                |
      |                vector<long long int>
art.cpp:34:16: error: could not convert 'a' from 'vector<long long int>' to 'vector<int>'
   34 |   ll v=publish(a);
      |                ^
      |                |
      |                vector<long long int>
art.cpp:40:9: error: could not convert 'pns' from 'vector<long long int>' to 'vector<int>'
   40 |  answer(pns);
      |         ^~~
      |         |
      |         vector<long long int>
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) {
      |        ~~~~~~~~~^~~~