이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<long long, long long> pl;
const int MOD = 1e9 + 7;
const ll INF = 1e18;
const double EPS = 1e-6;
vector<int> find_subset(int l, int u, vector<int> w) {
int n = (int)w.size();
vector<int> arr(n);
iota(arr.begin(), arr.end(), 0);
sort(arr.begin(), arr.end(), [&](int i, int j) {return w[i] < w[j];});
ll p1 = 0, sum = 0;
for (int i = 0; i < n; ++i) {
while (p1 < n && sum < l) sum += w[arr[p1++]];
if (l <= sum && sum <= u) {
vector<int> ans;
for (int j = i; j < p1; ++j) ans.push_back(arr[i]);
sort(ans.begin(), ans.end());
return ans;
}
}
return vector<int>();
}
# | 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... |