제출 #465203

#제출 시각아이디문제언어결과실행 시간메모리
465203dattranxxxDetecting Molecules (IOI16_molecules)C++11
컴파일 에러
0 ms0 KiB
/* * Author : shora */ #include <bits/stdc++.h> #define print(_v) for (auto &_ : _v) {cerr << _ << ' ';} cerr << endl; #include "molecules.h" using namespace std; using ll = long long; const int oo = 1e9; const int N = 2e5; map<int, int> dp[N]; int n; int call(int i, int l, vector<int>& a) { if (i == -1) return l <= 0 ? 0 : oo; return min(call(i-1, l-a[i], a) + a[i], call(i-1, l, a)); } vector<int> find_subset(int l, int u, vector<int> a) { n = a.size(); vector<int> res; if (call(n-1, l, a) > u) return res; int i = n-1; while (~i) { if (call(i-1, l-a[i], a) + a[i] < call(i-1, l, a)) { res.push_back(i); l -= a[i]; } i--; } return res; } int main() { int l, u; cin >> n >> l >> u; vector<int> a(n); for (int& x : a) cin >> x; vector<int> res = find_subset(l, u, a); print(res); }

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

/usr/bin/ld: /tmp/cckB4gZE.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cclROTcE.o:molecules.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status