제출 #996745

#제출 시각아이디문제언어결과실행 시간메모리
996745stdfloatDetecting Molecules (IOI16_molecules)C++17
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h" #include "molecules.h" #include "grader.cpp" using namespace std; using ll = long long; vector<int> find_subset(int L, int R, vector<int> w) { int n = (int)w.size(); pair<int, int> p[n]; for (int i = 0; i < n; i++) p[i] = {w[i], i}; sort(p, p + n); ll sm = 0; int l = 0; for (int i = 0; i < n; i++) { sm += p[i].first; while (sm > R) sm -= p[l++].first; if (L <= sm) { vector<int> v; while (l <= i) v.push_back(p[l++].second); return v; } } return {}; }

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

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