Submission #651635

#TimeUsernameProblemLanguageResultExecution timeMemory
651635inksamuraiArt Collections (BOI22_art)C++17
Compilation error
0 ms0 KiB
#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 (stderr)

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) {
      |        ~~~~~~~~~^~~~