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 <iostream>
#include <iomanip>
#include <string>
#include <math.h>
#include <algorithm>
#include <cstring>
#include <numeric>
#include <vector>
#include <bitset>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
using namespace std;
typedef long long ll;
#define dbg(x) cerr<<#x<<": "<<x<<"\n";
/*
one piece paceño
*/
vector<int> find_subset(int l, int u, vector<int> w){
int n=(int)w.size();
vector<int>ans;
vector<pair<int, int>>v(n);
for(int i=0 ; i<n ; i++){
v[i].first=w[i];
v[i].second=i;
}
sort(v.begin(), v.end());
int i=-1, j=-1;
long long mn=0;
while(1|!0){
if(mn<l){
j++;
if(j>=n) break;
mn+=v[j].first;
}else if(mn>u){
i++;
if(i>=j) break;
mn-=v[i].first;
}else{
for(int k=i+1 ; k<=j ; k++) ans.push_back(v[k].second);
return ans;
}
}
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... |