이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
typedef long long int lli;
vector< int > ans;
vector< pii > sweep;
vector<int> find_subset(int lower, int upper, vector<int> w)
{
int N = w.size();
for(int i = 0 ; i < N ; i++)
sweep.push_back( { w[i] , i } );
sort( sweep.begin() , sweep.end() );
int R = 0;
lli sum = 0;
for(int L = 0 ; L < N ; L++)
{
if( L > R )
{
R = L;
sum = 0;
}
while( R < N && sum < lower )
sum += sweep[ R++ ].first;
if( lower <= sum && sum <= upper )
{
for(int j = L ; j < R ; j++)
ans.push_back( sweep[j].second );
return ans;
}
sum -= sweep[L].first;
}
return ans;
}
| # | 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... |