제출 #575367

#제출 시각아이디문제언어결과실행 시간메모리
575367UzoufA 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 gg[10]; long long skim(int i) { return gg[i]; } void solve(int N, int K, long long A, int S) { vector<int> v(N); for (int i=0;i<N;i++) { v[i]=skim(i+1); } long long na=A*2; int a=-1,b=-1,c=-1; for (int l=0;l<N;l++) { for (int r=l+2;r<N;r++) { int need=na-(l+r); int ll=l+1,rr=r-1; int mid=upper_bound(v.begin()+ll,v.begin()+rr+1,need)-v.begin(); mid--; cout<<a<<' '<<r<<' '<<mid<<endl; if (mid>=r || mid<=ll) continue; long long chk=v[mid]+v[l]+v[r]; if (chk>=A && chk<=na) { a=v[l]; b=v[mid]; c=v[r]; break; } } if (a!=-1) break; } if (a==-1) impossible(); vector<int> ans; ans.push_back(a); ans.push_back(b); ans.push_back(c); //cout<<a<<' '<<b<<' '<<c; answer(ans); return; }

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

/usr/bin/ld: /tmp/ccPUo6SQ.o: in function `skim(int)':
grader.cpp:(.text+0x1a0): multiple definition of `skim(int)'; /tmp/ccU48I4Q.o:books.cpp:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status