#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
#define endl '\n'
#define pi pair<int, int>
#define f first
#define s second
const int maxn = 200000;
int n;
pi a[maxn];
vector<int> ans;
vector<int> find_subset(int l, int r, vector<int> v){
n = v.size();
for(int i = 0; i < n; i++) a[i] = {v[i], i + 1};
sort(a, a + n);
for(long long i = 0, j = 0, s = 0; i < n; i++){
s += a[i].f;
while(j < i && s > r) s -= a[j++].f;
if(l <= s && s <= r){
for(int k = j; k <= i; k++) ans.push_back(a[k].s);
return ans;
}
}
return {};
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
5 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
5 ms |
256 KB |
Integer 1 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
256 KB |
OK (n = 12, answer = YES) |
2 |
Correct |
5 ms |
384 KB |
OK (n = 12, answer = YES) |
3 |
Correct |
5 ms |
256 KB |
OK (n = 12, answer = NO) |
4 |
Correct |
5 ms |
256 KB |
OK (n = 12, answer = NO) |
5 |
Incorrect |
5 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 |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
5 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
5 ms |
256 KB |
Integer 1 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
5 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
5 ms |
256 KB |
Integer 1 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
5 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
5 ms |
256 KB |
Integer 1 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
5 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
5 ms |
256 KB |
Integer 1 violates the range [0, 0] |
4 |
Halted |
0 ms |
0 KB |
- |