제출 #622282

#제출 시각아이디문제언어결과실행 시간메모리
622282rrrr10000Art Collections (BOI22_art)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> P; typedef vector<ll> vi; typedef vector<vi> vvi; typedef vector<P> vp; typedef vector<vp> vvp; typedef vector<bool> vb; #define rep(i,n) for(ll i=0;i<(ll)(n);i++) #define REP(i,k,n) for(ll i=(ll)(k);i<(ll)(n);i++) #define all(a) a.begin(),a.end() #define lb(v,k) (lower_bound(all(v),k)-v.begin()) #define fi first #define se second #define pb emplace_back #define dupli(a) {sort(all(a));a.erase(unique(all(a)),a.end());} template<class T> void out(T a){cout<<a<<endl;} template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<endl;} template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;} template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;} const ll inf=1001001001001001001; void Solve(int N){ vi u,d; vector<int> ask(N);rep(i,N)ask[i]=i+1; ll f=publish(ask); REP(i,1,N){ swap(ask[0],ask[i]); ll g=publish(ask)-f; if(g>0){ vi nu; rep(j,g/2)nu.pb(u[j]); nu.pb(i+1); REP(j,g/2,u.size())nu.pb(u[j]); u=nu; } else{ vi nd; rep(j,(-g)/2)nd.pb(d[j]); nd.pb(i+1); REP(j,(-g)/2,d.size())nd.pb(d[j]); d=nd; } swap(ask[0],ask[i]); } vector<int> res; for(int i=d.size()-1;i>=0;i--)res.pb(d[i]); res.pb(1); rep(i,u.size())res.pb(u[i]); }

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

art.cpp: In function 'void Solve(int)':
art.cpp:27:10: error: 'publish' was not declared in this scope
   27 |     ll f=publish(ask);
      |          ^~~~~~~
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) {
      |        ~~~~~~~~~^~~~