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 <math.h>
#include <algorithm>
#include <cstring>
#include <numeric>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <unordered_map>
#include <unordered_set>
typedef long long ll;
using namespace std;
#define fr(i, x) for(ll i=0 ; i<x ; i++)
#define fra(x, v) for(auto x:v)
#define fra1(x, v) for(auto &x:v)
#define all(v) v.begin(), v.end()
vector<int> find_subset(int l, int u, vector<int> w){
int n=w.size();
vector<pair<int, int>>v(n);
vector<int>ans;
int pos=0;
fra(x, w){
v[pos].first=x;
v[pos].second=pos;
pos++;
}
sort(all(v));
int i=-1, j=-1, cc=0;
while(1){
if(cc<l){
j++;
if(j>=n) break;
cc+=v[j].first;
}else if(cc>u){
i++;
if(i>=j) break;
cc-=v[i].first;
}else{
for(ll a=i+1 ; a<=j ; a++){
ans.push_back(v[a].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... |