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 vi vector<int>
#define vvi vector<vi>
#define pi pair<int, int>
#define vpi vector<pi>
#define loop(a, b) for(int a = 0;a<b;a++)
#define all(a) a.begin(), a.end()
#define space << " " <<
#define flase false
#define fasle flase
using namespace std;
const int VeryBigNumber = 1e9 + 42 + 1;
const int VeryNiceNumber = 420 + 69;
void debug(vector<int>& a, string name){
cout << name << " :";
for(int i : a){
cout << " " << i;
}
cout << endl;
return;
}
vi find_subset(int l, int u, vi w){
int wnow = 0;
int n = w.size();
loop(i, n){
wnow += w[i];
if (wnow <= u and wnow >= l){
vi ans = {};
loop(j, i+1){
ans.push_back(j);
}
return ans;
}
}
return {};
}
/*
signed main(){
vi v = find_subset(5, 7, {1, 1, 1});
debug(v, "v");
return 0;
}
*/
/*
l < k*Wi < u
*/
# | 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... |