# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
106424 | DodgeBallMan | Detecting Molecules (IOI16_molecules) | C++14 | 82 ms | 6252 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 <bits/stdc++.h>
#include "molecules.h"
#define pii pair<int, int>
#define x first
#define y second
using namespace std;
vector<pii> v;
vector<int> ans;
vector<int> find_subset( int l, int u, vector<int> w ) {
for( int i = 0 ; i < w.size() ; i++ ) v.emplace_back( pii( w[i], i ) );
sort( v.begin(), v.end() );
int ll = 0, rr = 0;
long long sum = 0;
while( ll < w.size() ) {
while( rr < w.size() && sum < l ) sum += ( long long ) v[rr++].x;
if( sum >= l && sum <= u ) {
for( int i = ll ; i < rr ; i++ ) ans.emplace_back( v[i].y );
return ans;
}
sum -= ( long long ) v[ll++].x;
}
return {};
}
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... |