제출 #410863

#제출 시각아이디문제언어결과실행 시간메모리
410863MarceantasyDetecting Molecules (IOI16_molecules)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long pair<ll, int> w[200001]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, i; ll l, u, sum=0; cin >> n >> l >> u; pair<ll, int> *w = new pair<ll, int>[n+1]; for(i=0; i<n; ++i) cin >> w[i].first, w[i].second=i; sort(w, w+n); w[n]=make_pair(1LL<<31, -1); for(i=0; sum<=u; sum+=w[i].first, ++i); sum-=w[--i].first; for(int j=0; j<=min(i, n-i); sum+=w[n-1-j].first-w[j].first, ++j) { if(sum>=l) { cout << i << "\n"; for(int k=j; k<i; ++k) cout << w[k].second << " "; for(int k=0; k<j; ++k) cout << w[n-1-k].second << " "; return 0; } } cout << 0; }

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

/usr/bin/ld: /tmp/cc2Lt7BU.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccScAhgT.o:molecules.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc2Lt7BU.o: in function `main':
grader.cpp:(.text.startup+0x18d): undefined reference to `find_subset(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status