This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
* Author : shora
*/
#include <bits/stdc++.h>
#define print(_v) for (auto &_ : _v) {cerr << _ << ' ';} cerr << endl;
#include "molecules.h"
using namespace std;
using ll = long long;
const int oo = 1e9;
const int N = 1e4, U = 1e4;
int dp[U + 1];
int n;
vector<int> find_subset(int l, int u, vector<int> a) {
n = a.size();
sort(a.begin(), a.end());
vector<int> res;
for (int i = 0, j = 0, sum = 0; i < n;) {
while (j < n && sum < l) {
sum += a[j]; j++;
}
j--;
if (sum >= l && sum <= u) {
for (int k = i; k <= j; ++k)
res.push_back(k);
return res;
}
sum -= a[i]; i++;
}
return res;
}
# | 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... |