Submission #651618

#TimeUsernameProblemLanguageResultExecution timeMemory
651618inksamuraiArt Collections (BOI22_art)C++17
Compilation error
0 ms0 KiB

#include "art.h"

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

Compilation message (stderr)

art.cpp: In function 'void solve(int)':
art.cpp:6:2: error: 'vi' was not declared in this scope
    6 |  vi pns(n);
      |  ^~
art.cpp:7:6: error: 'pvt' was not declared in this scope
    7 |  rep(pvt,n){
      |      ^~~
art.cpp:7:2: error: 'rep' was not declared in this scope
    7 |  rep(pvt,n){
      |  ^~~
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) {
      |        ~~~~~~~~~^~~~