Submission #783911

#TimeUsernameProblemLanguageResultExecution timeMemory
783911AlfraganusDetecting Molecules (IOI16_molecules)C++14
Compilation error
0 ms0 KiB
// #include "molecules.h"
#include "grader.cpp"
#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()

vector<int> find_subset(int l, int u, vector<int> w) {
    int n = w.size(), j = 0, i = 0, s = 0;
    vector<pair<int, int>> a(n);
    for(int i = 0; i < n; i ++)a[i] = {w[i], i};
    while(i < n){
        s += a[i].first;
        i ++;
        while(s > u)s -= a[j ++].first;
        if(l <= s and s <= u){
            vector<int> ans;
            for(int x = j; x < i; x ++){
                ans.push_back(a[x].second);
            }
            return ans;
        }
    }
    return {};
}

Compilation message (stderr)

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