#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
vector<int> find_subset(int l, int u, std::vector<int> w) {
int n=w.size();
vector<pii> p(n);
vector<int> ans;
for(int i=0;i<n;i++) p[i]={w[i],i};
sort(p.begin(),p.end());
long long psum=0;
if(p[0].first>=l && p[0].first<=u) return vector<int>(1,p[0].second);
for(int i=0;i<n-1;i++){
psum+=p[i].first;
if(psum<=l && psum+p[n-1].first>=l+p[0].first){
for(int j=1;j<=i;j++) ans.push_back(p[j].second);
ans.push_back(p[n-1].second);
return ans;
}
}
psum+=p[n-1].first;
if(psum>=l && psum<=u){
for(pii &t : p) ans.push_back(t.second);
return ans;
}
return vector<int>(0);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
2024 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
2024 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
0 ms |
2024 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
2024 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
0 ms |
2024 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = NO) |
17 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = NO) |
18 |
Correct |
0 ms |
2024 KB |
OK (n = 100, answer = NO) |
19 |
Correct |
0 ms |
2024 KB |
OK (n = 100, answer = YES) |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
2024 KB |
Contestant can not find answer, jury can |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
2024 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
2024 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
0 ms |
2024 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
2024 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
0 ms |
2024 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = NO) |
17 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = NO) |
18 |
Correct |
0 ms |
2024 KB |
OK (n = 100, answer = NO) |
19 |
Correct |
0 ms |
2024 KB |
OK (n = 100, answer = YES) |
20 |
Incorrect |
0 ms |
2024 KB |
Contestant can not find answer, jury can |
21 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
2024 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
2024 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
0 ms |
2024 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
2024 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
0 ms |
2024 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = NO) |
17 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = NO) |
18 |
Correct |
0 ms |
2024 KB |
OK (n = 100, answer = NO) |
19 |
Correct |
0 ms |
2024 KB |
OK (n = 100, answer = YES) |
20 |
Incorrect |
0 ms |
2024 KB |
Contestant can not find answer, jury can |
21 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
2024 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
2024 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
0 ms |
2024 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
2024 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
0 ms |
2024 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = NO) |
17 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = NO) |
18 |
Correct |
0 ms |
2024 KB |
OK (n = 100, answer = NO) |
19 |
Correct |
0 ms |
2024 KB |
OK (n = 100, answer = YES) |
20 |
Incorrect |
0 ms |
2024 KB |
Contestant can not find answer, jury can |
21 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
2024 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
2024 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
0 ms |
2024 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
2024 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
0 ms |
2024 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = NO) |
17 |
Correct |
0 ms |
2024 KB |
OK (n = 3, answer = NO) |
18 |
Correct |
0 ms |
2024 KB |
OK (n = 100, answer = NO) |
19 |
Correct |
0 ms |
2024 KB |
OK (n = 100, answer = YES) |
20 |
Incorrect |
0 ms |
2024 KB |
Contestant can not find answer, jury can |
21 |
Halted |
0 ms |
0 KB |
- |