#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define f first
#define s second
using namespace std;
vector <int> find_subset (int l, int u, vector <int> w){
int n = w.size();
vector<int> r;
vector<pair<ll,ll>> vec;
for(int i=0;i<n;i++)vec.pb({w[i],i});
sort(vec.begin(),vec.end());
ll sum = 0;
for(int i=0,j=0;j<n;j++){
sum += vec[j].f;
while(sum>u){
sum -= vec[i++].f;
}
if(sum>l){
for(int k=i;k<=j;k++){
r.pb(vec[k].s);
}
break;
}
}
return r;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
5 ms |
256 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
256 KB |
OK (n = 12, answer = YES) |
2 |
Correct |
4 ms |
256 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 |
Correct |
5 ms |
256 KB |
OK (n = 12, answer = YES) |
6 |
Incorrect |
5 ms |
384 KB |
Contestant can not find answer, jury can |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
5 ms |
256 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
5 ms |
256 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
5 ms |
256 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
4 ms |
256 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
5 ms |
256 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |