이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll INF = (ll)1<<62;
const ll MOD = 1e9+7;
const int iINF = 1<<30;
const double PI = 3.14159265359;
vector<int> find_subset(int l, int u, vector<int> w){
vector<pair<int, int> > wd;
for(int i=0;i<(int)w.size();i++) wd.pb({w[i], i});
sort(wd.begin(), wd.end());
deque<int> ans;
int i = 0, s = 0;
while(i<(int)w.size()){
s += wd[i].ff;
ans.pb(wd[i].ss);
while(s > u){
s -= w[ans.front()];
ans.pop_front();
}
i++;
if(s >= l && s <= u){
vector<int> ret;
for(int v : ans) ret.pb(v);
return ret;
}
}
return {};
}
# | 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... |