Submission #651632

# Submission time Handle Problem Language Result Execution time Memory
651632 2022-10-19T13:24:49 Z inksamurai Art Collections (BOI22_art) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.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...);}

#include "art.h"

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);
		}
		int u=publish(a);
		a.erase(a.begin());
		a.pb(pvt+1);
		int v=publish(a);
		assert((u+v-n+1)%2==0);
		int z=(u+v-n+1)/2;
		int x=u-z;
		pns[x]=pvt+1;
	}
	answer(pns);
}

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) {
      |        ~~~~~~~~~^~~~
/usr/bin/ld: /tmp/cclTZlPY.o: in function `solve(long long)':
art.cpp:(.text+0x213): undefined reference to `publish(std::vector<long long, std::allocator<long long> >)'
/usr/bin/ld: art.cpp:(.text+0x309): undefined reference to `publish(std::vector<long long, std::allocator<long long> >)'
/usr/bin/ld: art.cpp:(.text+0x418): undefined reference to `answer(std::vector<long long, std::allocator<long long> >)'
/usr/bin/ld: /tmp/ccHpUN3W.o: in function `main':
interface.cpp:(.text.startup+0x16): undefined reference to `solve(int)'
collect2: error: ld returned 1 exit status