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>
using namespace std;
vector<int> find_subset(int L, int R, vector<int> w){
int n = w.size();
vector<int> ans;
if(w[0]>=L && w[0]<=R) {ans.push_back(0); return ans;}
int l=0, r=1, sum=w[0];
while(r<n){
if(sum<=R) sum += w[r++];
if(sum>R) sum -= w[l++];
if(sum>=L && sum<=R){
for(int i = l; i < r; i++) ans.push_back(i);
break;
}
}
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... |