제출 #651620

#제출 시각아이디문제언어결과실행 시간메모리
651620inksamuraiArt Collections (BOI22_art)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> 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); 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); }

컴파일 시 표준 에러 (stderr) 메시지

art.cpp: In function 'void solve(int)':
art.cpp:31:9: error: 'ask' was not declared in this scope
   31 |   int u=ask(a);
      |         ^~~
art.cpp:40:9: error: 'pvt' was not declared in this scope
   40 |  answer(pvt);
      |         ^~~
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) {
      |        ~~~~~~~~~^~~~