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>
using namespace std;
std::vector<int> find_subset(int l, int u, std::vector<int> z) {
vector<int> w=z;
sort(w.begin(),w.end());
int n=(int)(w.size());
int pre=0, x=0;
for (auto i: w){
if (pre+i<l) pre+=i, x++;
}
if (x==0){
return {0};
}
int sum=pre, nxt=x, prev=0;
while (sum<l and nxt<n){
sum-=w[prev]; sum+=w[nxt];
nxt++;
prev++;
}
if (sum<l){
return {};
}
if (!(sum>=l and sum<=u)){
while(true){
}
}
vector<int> ans;
for (int i=prev; i<nxt; i++){
ans.push_back(i);
}
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... |