# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
770620 | Benmath | Detecting Molecules (IOI16_molecules) | C++14 | 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 <cstdio>
#include <vector>
#include <cassert>
*/
/*
#include<bits/stdc++.h>
using namespace std;
*/
#include "molecules.h"
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
long long int sum=0;
vector<int>ans;
for(int i=0;i<w.size();i++){
if(w[i]<=u){
sum=sum+w[i];
ans.push_back(i);
}
if(sum>=l and sum<=u){
break;
}
}
if(sum>=l and sum<=u){
return ans;
}else{
ans.clear();
return ans;}
}
/*
int main() {
int n, l, u;
assert(3 == scanf("%d %d %d", &n, &l, &u));
std::vector<int> w(n);
for (int i = 0; i < n; i++)
assert(1 == scanf("%d", &w[i]));
std::vector<int> result = find_subset(l, u, w);
printf("%d\n", (int)result.size());
for (int i = 0; i < (int)result.size(); i++)
printf("%d%c", result[i], " \n"[i == (int)result.size() - 1]);
}
*/