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;
typedef long long ll;
vector<int> find_subset(int l, int u, vector<int> w) {
ll n = w.size();
ll i=0,j=0,s=0;
// i - next to be removed
// j - next to be added
bool movement=true;
while(movement)
{
movement = false;
while(j<n&&s<l) s+=w[j++], movement=1;
while(i<j&&s>u) s-=w[i++], movement=1;
}
if(s>=l&&s<=u)
{
vector<int> res;
for(ll k=i;k<j;k++) res.push_back(k);
return res;
}
return vector<int>(0);
}
# | 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... |