이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
#define F first
#define S second
#define pb push_back
#define pq priority_queue
#define pl pair<ll,ll>
#define pi pair<int,int>
#include "molecules.h"
using namespace std;
constexpr int debug = 0;
vector<int> find_subset(int l, int u, vector<int> w){
vector<int> ans;
ll sum = 0;
unsigned int poc, kon;
poc = 0, kon = 0;
vector<pi> odp;
int sus = 0;
for(auto k: w){
sus++;
odp.pb({k, sus});
}
sort(odp.rbegin(), odp.rend());
while(kon < odp.size()){
sum += odp[kon].F;
//cout << poc << ' ' << kon << ' ' << sum << '\n';
while((sum > u) && (poc <= kon)){
sum -= odp[poc].F;
poc++;
}
if((sum >= l) && (sum <= u) && (poc <= kon)){
while(poc <= kon){
ans.pb(odp[poc].S);
poc++;
}
return ans;
}
kon++;
}
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... |