This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
long long s = 0;
vector<pair<int, int>> a(n);
for(int i = 0; i < n; i ++)a[i] = {w[i], i};
sort(all(a));
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 {};
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |