# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
156154 | joseacaz | Detecting Molecules (IOI16_molecules) | C++17 | 59 ms | 5612 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;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
vi find_subset ( int l, int u, vi _w )
{
vector < pii > w;
vi ans;
for ( int i = 0; i < _w.size(); i++ )
w.push_back ( {_w[i], i} );
sort ( w.begin(), w.end() );
int rpnt = 0, sum = 0;
for ( int i = 0; i < w.size(); i++ )
{
for ( ; rpnt < w.size(); rpnt++ )
{
if ( sum + w[rpnt].first > u )
break;
sum += w[rpnt].first;
}
if ( sum >= l )
{
ans.clear();
for ( int k = i; k < rpnt; k++ )
ans.push_back ( w[k].second );
return ans;
}
sum -= w[i].first;
}
return vi(0);
}
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... |