#include<bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
vector<int> find_subset(int l, int u, vector<int> w)
{
int n = w.size();
vector<pii> nums(n);
for (int i = 0; i < n; i++) nums[i] = {w[i], i};
sort(nums.begin(), nums.end());
long long sum = 0;
int r = 0;
for (int i = 0; i < n; i++)
{
while (r< n && sum < l)
{
sum += nums[r].first;
r++;
}
if (sum <= u)
{
vector<int> ans;
for (int j = i; j < min(r, n); j++)
{
ans.push_back(nums[j].second);
}
return ans;
}
sum -= nums[i].first;
}
vector<int> ans(0);
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
sum of weights should be in [10..12] but it is 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
OK (n = 12, answer = YES) |
2 |
Correct |
0 ms |
348 KB |
OK (n = 12, answer = YES) |
3 |
Incorrect |
0 ms |
348 KB |
sum of weights should be in [307..317] but it is 306 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
sum of weights should be in [10..12] but it is 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
sum of weights should be in [10..12] but it is 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
sum of weights should be in [10..12] but it is 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
sum of weights should be in [10..12] but it is 9 |
2 |
Halted |
0 ms |
0 KB |
- |