| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1354644 | nini_gvenetadze | Detecting Molecules (IOI16_molecules) | C++20 | 26 ms | 3752 KiB |
#include<bits/stdc++.h>
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w)
{
int n=w.size();
long long p=0;
vector<pair<int, int> > vec(n);
for(long long i=0; i<n; i++)
{
vec[i].first=w[i];
vec[i].second=i;
}
sort(vec.begin(), vec.end());
vector<int> vec2;
long long int sum=0;
//vector
for(long long i=0; i<n; i++)
{
sum+=vec[i].first;
// long long p=0;
while(sum>u && p<=i)
{
sum-=vec[p].first;
p++;
}
if(sum>=l && sum<=u)
{
for(long long k=p; k<=i; k++){
vec2.push_back(vec[k].second);}
return vec2;
}
}
return {};
} | # | 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... | ||||
