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;
#define ll long long
#define forn(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
#define sz(a) (int)a.size()
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define GR(a,n,m) vector<vector<int>> a(n, vector<int>(m, 0));
vector<int> find_subset(int u, int v, std::vector<int> c)
{
int n = sz(c);
vector<pair<int,int>> a(n);
for(int i = 0;i < n;i++){
a[i].first = c[i];
a[i].second = i;
}
sort(all(a));
vector<int> ret;
ll w = 0;
for(int i = 0, j = 0;i < n;i++)
{
if(j - 1>= i && j - 1 < n && w >= u && w <= v)
{
vector<int> ret;
for(int k = i;k <= j - 1;k++){
ret.pb(a[k].second);
}
return ret;
}
while(j < n && w < u)
{
w += a[j].first;
if(w <= v && w >= u){
vector<int> ret;
for(int k = i;k <= j;k++){
ret.pb(a[k].second);
}
return ret;
}
++j;
}
w -= a[i].first;
}
return {};
}
# | 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... |