| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1325770 | antarbanik | Detecting Molecules (IOI16_molecules) | C++20 | 1 ms | 376 KiB |
#include<bits/stdc++.h>
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w){
int n = w.size();
vector<int> ans;
bool f = 0;
for(int i = 0;i<n;++i){
vector<int> temp;
temp.push_back(i);
bool f2 = 0;
int s = w[i];
for(int j = i+1;j<n;++j){
s += w[j];
temp.push_back(j);
if(s >= l && s <= u){
f = 1;
f2 = 1;
break;
}
}
if(f2){
ans = temp;
break;
}
}
if(!f) ans.clear();
return ans;
}
// int main(){
// vector<int> v = find_subset(6, 10, {10, 1, 2, 3, 9});
// for(auto e : v) cout<<e<<" ";
// }Compilation message (stderr)
| # | 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... | ||||
