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"
#define all(v) v.begin(), v.end()
#define pb push_back
#define ss second
#define ff first
#define vt vector
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, int> pdi;
const int inf = 1e9 + 10000;
const int mod = 1e9+7;
const int maxn = 5e5 + 12;
vector<int> find_subset(int l, int u, vector<int> w) {
int n = w.size();
int s = 0, j = 0;
pair<int, int> p[n];
for(auto i : w) {
p[j] = {i, j};
j++;
}
sort(p, p + n);
j = 0;
vi ans;
while(j < n && s < l) {
s += p[j].ff;
ans.pb(p[j].ss);
j++;
}
if(s < l || s > u) {
return vi(0);
}
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... |