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>
using namespace std;
#define ll long long
#define all(x) x.begin(), x.end()
#define f first
#define s second
#define ca(v) for(auto i:v) cout<<i<<" ";
#define nl cout<<"\n"
const int MOD = 1e9 + 7;
vector<int> find_subset(int l, int r, vector<int> ar){
sort(all(ar));
int n = ar.size();
ll sm = 0;
int p = 0;
vector<int> emp = {};
if(ar[0] > l) return emp;
for(int i=0; i<n; i++){
if(ar[i] + sm > r) break;
sm += ar[i];
p = i;
}
for(int i=0; i<n; i++){
if(sm >= l && sm <= r){
vector<int> out = {};
for(int j=i; j<=p+i; j++){
out.push_back(j);
}
return out;
}
if(i + 1 + p >= n) break;
sm -= ar[i];
sm += ar[i+p+1];
}
return emp;
}
# | 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... |