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