#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<ll,ll>
#define ff first
#define ss second
#define pb push_back
vector<int> find_subset(int l, int u, std::vector<int> w){
int N = w.size();
vector<pii> obj(N);
for(int i = 0; i < N; i++) obj[i] = {w[i], i};
sort(obj.begin(), obj.end());
vector<int> v(N+1, 0);
for(int i = 1; i <= N; i++) v[i] = v[i-1] + obj[i-1].ff;
vector<int> ans;
for(int i = 1; i <= N; i++){
int p = upper_bound(v.begin(), v.end(), v[i-1]+u+1) - v.begin() - 1;
if(p < 0 || v[p] - v[i-1] < l || v[p] - v[i-1] > u) continue;
for(; i <= p; i++) ans.pb(obj[i].ss);
return ans;
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
1 ms |
384 KB |
Integer 33 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
256 KB |
OK (n = 12, answer = YES) |
2 |
Correct |
1 ms |
384 KB |
OK (n = 12, answer = YES) |
3 |
Correct |
0 ms |
256 KB |
OK (n = 12, answer = NO) |
4 |
Correct |
0 ms |
256 KB |
OK (n = 12, answer = NO) |
5 |
Incorrect |
0 ms |
256 KB |
sum of weights should be in [290..300] but it is 301 |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
1 ms |
384 KB |
Integer 33 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
1 ms |
384 KB |
Integer 33 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
1 ms |
384 KB |
Integer 33 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
1 ms |
384 KB |
Integer 33 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |