Submission #651351

#TimeUsernameProblemLanguageResultExecution timeMemory
651351pauloamedDetecting Molecules (IOI16_molecules)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "molecules.h" using namespace std; vector<int> find_subset(int l, int u, vector<int> w){ int n = w.size(); vector<pair<int,int>> W; for(int i = 0; i < n; ++i){ W.push_back({w[i], i}); } sort(W.begin(), W.end()); vector<int> ans; for(int i = 0; i < n; ++i){ int mini = W[i].first; int id_mini = W[i].second; int maxi = W.back().first; int id_maxi = W.back().second; if(mini > u) return {}; else if(mini >= l){ ans.push_back(id_mini); return ans; }else{ // mini ta a esquerda // maxi ta dentro ou a esquerda assert(maxi <= u); ans.push_back(id_maxi); if(maxi >= l){ // maxi ta dentro return ans; }else{ // maxi ta a esquerda l -= maxi; u -= maxi; } } } if(0 >= l && 0 <= u) return ans; else return {}; } int32_t main(){ }

Compilation message (stderr)

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