이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*
@AUTHOR: BY_KUTBILIM
FILE CREATED: 16.11.2021 17:46:37 (GMT+6)
*/
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define sz(x) int((x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define fi first
#define se second
#define pb push_back
using ll = long long;
using pii = pair<int, int>;
vector<int> find_subset(int st, int dr, vector<int> w){
int n = sz(w);
queue<pair<int,int>> q;
vector<pair<int,int>> v;
for(int i = 0; i < n; i++){
v.pb({w[i], i});
}
sort(all(v));
int sum = 0;
for(int i = 0; i < n; i++){
q.push(v[i]);
sum += v[i].fi;
while(sum > dr and !q.empty()){
sum -= q.front().fi;
q.pop();
}
if(st <= sum and sum <= dr){
vector<int> ans;
while(!q.empty()){
ans.pb(q.front().se);
q.pop();
}
return ans;
}
}
return vector<int>(0);
}
# | 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... |