#include <bits/stdc++.h>
#define ll long long
#define all(a) a.begin(),a.end()
#define mp make_pair
#define F first
#define S second
#define pii pair<int,int>
using namespace std;
vector<int> find_subset(int l , int r , vector<int> a){
int sum= 0 ;
for(int x :a) sum+= x ;
set<int> ans ;
int n = a.size() ;
for(int i=0;i<n;i++) ans.insert(i) ;
vector<int> re ;
set<pii> b ;
for(int i=0;i<n;i++) b.insert(mp(a[i],i)) ;
while(1){
if(b.empty()) break ;
if(r>=sum) break ;
auto it = b.end() ;
it-- ;
pii w = *it ;
if(sum-w.F>r){
sum-=w.F ;
b.erase(it) ;
ans.erase(w.S) ;
}
else if(sum-w.F<l){
b.erase(it) ;
}
else{
b.erase(it) ;
ans.erase(w.S) ;
sum-=w.F ;
}
}
//if(sum>r) return re ;
// cout << 1 << " " ;
for(int x : ans) re.push_back(x) ;
if(ans.size()&&sum<=r&&l<=sum)return re ;
vector<int> pp ;
return pp ;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
324 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
256 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
1 ms |
256 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
1 ms |
256 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
17 |
Correct |
1 ms |
256 KB |
OK (n = 3, answer = NO) |
18 |
Correct |
0 ms |
384 KB |
OK (n = 100, answer = NO) |
19 |
Correct |
0 ms |
256 KB |
OK (n = 100, answer = YES) |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
Contestant can not find answer, jury can |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
324 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
256 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
1 ms |
256 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
1 ms |
256 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
17 |
Correct |
1 ms |
256 KB |
OK (n = 3, answer = NO) |
18 |
Correct |
0 ms |
384 KB |
OK (n = 100, answer = NO) |
19 |
Correct |
0 ms |
256 KB |
OK (n = 100, answer = YES) |
20 |
Incorrect |
0 ms |
256 KB |
Contestant can not find answer, jury can |
21 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
324 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
256 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
1 ms |
256 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
1 ms |
256 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
17 |
Correct |
1 ms |
256 KB |
OK (n = 3, answer = NO) |
18 |
Correct |
0 ms |
384 KB |
OK (n = 100, answer = NO) |
19 |
Correct |
0 ms |
256 KB |
OK (n = 100, answer = YES) |
20 |
Incorrect |
0 ms |
256 KB |
Contestant can not find answer, jury can |
21 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
324 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
256 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
1 ms |
256 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
1 ms |
256 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
17 |
Correct |
1 ms |
256 KB |
OK (n = 3, answer = NO) |
18 |
Correct |
0 ms |
384 KB |
OK (n = 100, answer = NO) |
19 |
Correct |
0 ms |
256 KB |
OK (n = 100, answer = YES) |
20 |
Incorrect |
0 ms |
256 KB |
Contestant can not find answer, jury can |
21 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
256 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
324 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
1 ms |
256 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
256 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
1 ms |
256 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
1 ms |
256 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
256 KB |
OK (n = 3, answer = NO) |
17 |
Correct |
1 ms |
256 KB |
OK (n = 3, answer = NO) |
18 |
Correct |
0 ms |
384 KB |
OK (n = 100, answer = NO) |
19 |
Correct |
0 ms |
256 KB |
OK (n = 100, answer = YES) |
20 |
Incorrect |
0 ms |
256 KB |
Contestant can not find answer, jury can |
21 |
Halted |
0 ms |
0 KB |
- |