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>
#define pb push_back
#define vii vector<int>
#define task "LAZY"
#define pll pair<ll, ll>
#define pii pair< pll, ll >
#define fi first
#define se second
using namespace std;
using ll = int;
using ull = unsigned long long;
const int N = 1e6+5;
const ll mod = 1e9+7;
const ll base1 = 1313;
const ll base2 = 3113;
ll m, n, k, t, T, ans;
long long tong;
pll a[N], b[N];
vector<ll> kq;
vector<int> find_subset(int l, int u, vector<int> w)
{
n = w.size();
for(int i = 1; i <= n; i ++)
{
a[i].fi = w[i-1];
a[i].se = i-1;
}
sort(a+1, a+1+n);
int j = 1;
for(int i = 1; i <= n; i ++)
{
tong += a[i].fi;
if(tong > u)tong -= a[j].fi, ++j;
if(tong >= l)
{
for(int id = j; id <= i; id ++)kq.pb(a[id].se);
return kq;
}
}
return kq;
}
# | 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... |