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 <bits/stdc++.h>
#include "molecules.h"
using namespace std;
vector<int> find_subset(int l, int r, vector<int> w) {
vector<pair<int, int>> v;
int n = w.size(); v.push_back({0, 0});
for(int i = 1; i <= n; i ++) {
v.push_back({w[i - 1], i});
}
sort(v.begin(), v.end());
int sum = 0;
for(int i = 1, j = 1; i <= n; i ++) {
sum += v[i].first;
while(sum > r) {
sum -= v[j].first;
j ++;
}
if(sum >= l) {
vector<int> ans;
for(int ind = j; ind <= i; ind ++) {
ans.push_back(v[ind].second);
}
return ans;
}
}
vector<int> am_belit_coaiele;
return am_belit_coaiele;
}
# | 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... |