# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1211829 | Marco_Escandon | Detecting Molecules (IOI16_molecules) | C++20 | 0 ms | 328 KiB |
#include "molecules.h"
#include<bits/stdc++.h>
using namespace std;
typedef int ll;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
sort(w.rbegin(),w.rend());
ll ac=0;
vector<ll> ans;
for(int i=0; i<w.size(); i++)
{
ac+=w[i];
if(ac>=l&&ac<=u)
{
for(int j=0; j<=i; j++)
ans.push_back(j);
return ans;
}
if(i!=0&&ac>=l&&ac+w.back()-w[0])
{
for(int j=0; j<i; j++)
ans.push_back(j);
ans.push_back(w.size()-1);
return ans;
}
}
return ans;
}
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... |