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>
typedef long long ll;
typedef unsigned long long ull;
#define F first
#define S second
#define pb push_back
#define pq priority_queue
#define pl pair<ll,ll>
#include "molecules.h"
using namespace std;
constexpr int debug = 0;
vector<int> find_subset(int l, int u, vector<int> w){
vector<int> ans;
ll sum = 0;
unsigned int poc, kon;
poc = 0, kon = 0;
sort(w.rbegin(), w.rend());
while(kon < w.size()){
sum += w[kon];
//cout << poc << ' ' << kon << ' ' << sum << '\n';
while((sum > u) && (poc <= kon)){
sum -= w[poc];
poc++;
}
if((sum >= l) && (sum <= u) && (poc <= kon)){
while(poc <= kon){
ans.pb(w[poc]);
poc++;
}
return ans;
}
kon++;
}
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... |