# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1087182 | MahmytM | 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>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
int find_subset(int l, int u, int[] w, int n, int[] result){
int sum=0,k=0;
for(int i=0;i<n;i++){
if(sum+w[i]<u){
sum+=w[i];
k++,result[k]=i;
}
}
if(l<=sum and sum<=u){
return result;
}else{
return 0;
}
}