# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1019884 | vjudge1 | Detecting Molecules (IOI16_molecules) | C++17 | 0 ms | 0 KiB |
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 int long long
#define vi vector<long long>
#define vvi vector<vi>
#define pi pair<long long, long long>
#define vpi vector<pi>
#define loop(a, b) for(long long 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 = 1e18 + 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, 1, 1, 1, 1});
debug(v, "v");
return 0;
}
*/
/*
l < k*Wi < u
*/