제출 #574892

#제출 시각아이디문제언어결과실행 시간메모리
574892UzoufA Difficult(y) Choice (BOI21_books)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> #include"books.h" using namespace std; //using namespace __gnu_pbds; //#define ll long long //#define endl "\n" //int mod=1e9+7; //const int N=2e5+5; //template<class x> //using ordered_multiset = tree<x, null_type,less_equal<x>, rb_tree_tag,tree_order_statistics_node_update>; long long okr[7]; long long skim(int i) { return okr[i]; } void solve(int N, int K, long long A, int S) { long long v[N]; for (int i=0;i<N;i++) { v[i]=skim(i+1); } long long na=A*2; long long a=-1,b=-1,c=-1; for (int l=0;l<N;l++) { for (int r=l+2;r<N;r++) { long long nd=na-(v[l]+v[r]); //cout<<v[l]<<' '<<v[r]<<' '<<nd<<endl; int tmp=upper_bound(v+l+1,v+r,nd)-v+l+1; if (tmp<N) tmp--; else continue; if (tmp==r) tmp--; long long chk=v[l]+v[r]+v[tmp]; if (chk>=A && chk<=na) { //cout<<nd<<' '<<tmp<<endl; a=v[l]; b=v[r]; c=v[tmp]; break; } if (a!=-1) break; } } if (a==-1) impossible(); answer(a,b,c); return; }

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

books.cpp: In function 'void solve(int, int, long long int, int)':
books.cpp:45:12: error: could not convert 'a' from 'long long int' to 'std::vector<int>'
   45 |     answer(a,b,c);
      |            ^
      |            |
      |            long long int