| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1282733 | enzy | Detecting Molecules (IOI16_molecules) | C++20 | 0 ms | 0 KiB |
#include "molecules.h"
#include<bits/stdc++.h>
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w){
int sum=0, at=0;
for(int i=0;i<w.size();i++){
sum+=w[i];
while(sum>r){
sum-=w[at];
at++;
}
if(l<=sum&&sum<=r){
vector<int>resp;
for(int j=at;j<=i;j++) resp.push_back(j);
return resp;
}
}
return {};
}
