# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
239129 | T0p_ | Detecting Molecules (IOI16_molecules) | C++14 | 5 ms | 384 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> find_subset(int l, int u, vector<int> w)
{
vector<int> ans;
int n = w.size();
long long sum = 0;
deque<int> deq;
sort(w.begin(), w.end());
for(int i=0 ; i<n ; i++)
{
deq.push_back(w[i]);
sum += w[i];
while(sum > u)
{
sum -= deq.front();
deq.pop_front();
}
if(l <= sum && sum <= u)
{
while(!deq.empty())
{
ans.push_back(deq.front());
deq.pop_front();
}
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... |