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 <bits/stdc++.h>
#define fr first
#define sc second
#define pb push_back
#define all(s) s.begin(), s.end()
using namespace std;
vector <int> ans;
vector <pair <int, int> > w;
vector<int> find_subset(int l, int r, vector<int> asd) {
int j = 0;
long long sum = 0;
for (int i = 0; i < (int)asd.size(); i++) {
w.pb({asd[i], i});
}
sort(all(w));
for (int i = 0; i < (int)w.size(); i++) {
sum += w[i].fr;
while (j <= i && sum > r) {
sum -= w[j].fr;
j++;
}
if (sum >= l && sum <= r) {
for (int k = j; k <= i; k++) {
ans.pb(w[k].sc);
}
return ans;
}
}
return ans;
}
# | 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... |