| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1354612 | nataliaa | Detecting Molecules (IOI16_molecules) | C++20 | 0 ms | 344 KiB |
#include<bits/stdc++.h>
#include "molecules.h"
using namespace std;
vector<int> find_subset(int L, int u,vector<int> w){
int n = w.size();
vector<pair<int, int>> p;
vector<int> ans;
for(int i = 0; i < n; i++) {
p.push_back({w[i], i});
}
long long l = 0, r = 0, s = 0;
while(l<n&&r<n) {
if(s>=L&&s<=u){
for(int i = l; i<=r; i++) ans.push_back(p[i].second+1);
return ans;
}
//cout << s <<" "<< l <<" "<< r << endl;
s+=p[r].first;
//cout << L <<" "<< u<<endl;
if(s>=L&&s<=u){
for(int i = l; i<=r; i++) ans.push_back(p[i].second+1);
return ans;
}
if(s<L) r++;
else {
s-=p[l].first;
l++;
}
}
return ans;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
