Submission #103912

# Submission time Handle Problem Language Result Execution time Memory
103912 2019-04-03T08:58:26 Z Hideo Detecting Molecules (IOI16_molecules) C++14
Compilation error
0 ms 0 KB
//#include "molecules.h"
#include <bits/stdc++.h>
#include "grader.cpp"

using namespace std;

#define ll long long
#define pb push_back
#define mk make_pair
#define fr first
#define sc second
#define vi vector < int >
#define pi pair < int, int >

int n, lf;
ll s;

std::vector<int> find_subset(int l, int u, std::vector <int> w) {
    vi ans;
    n = w.size();
    sort(w.begin(), w.end());
    for (int i = 0; i < n; i++){
        s += w[i];
        if (s > u){
            s -= w[lf];
            lf++;
        }
        if (s >= l && s <= u){
            for (int j = lf; j <= i; j++)
                ans.pb(w[j]);
            break;
        }
    }
    if (s > u)
        while(true);
    return ans;
}

Compilation message

/tmp/cca7i3vl.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccbYemfw.o:molecules.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status