/**
* بسم الله الرحمن الرحيم *
﴾ رَبِّ اشْرَحْ لِي صَدْرِي * وَيَسِّرْ لِي أَمْرِي * وَاحْلُلْ عُقْدَةً مِّن لِّسَانِي * يَفْقَهُوا قَوْلِي ﴿
*/
/// author : "ASGA"
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define ONLINE 0
#ifdef ONLINE_JUDGE
#undef ONLINE;
#define ONLINE 1
#endif
#define dbg(a) if(!ONLINE)cout << a << ' ';
const ll inf = 1e18;
vector <int> find_subset(int l,int r,vector <int> A){
int n = A.size();
vector <array <ll,2>> a(n);
for(int i = 0;i < n;i++)a[i] = {A[i],i};
sort(a.begin(),a.end());
reverse(a.begin(),a.end());
ll sum = 0;
vector <int> ans;
for(int i = 0;i < n;i++){
if(a[i][0] + sum > r)continue;
ans.push_back(a[i][1]);sum += a[i][0];
}
sort(ans.begin(),ans.end());
if(sum >= l)return ans;
else return {};
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
348 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
0 ms |
440 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
348 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
0 ms |
344 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
1 ms |
344 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
424 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
344 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = NO) |
17 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = NO) |
18 |
Correct |
1 ms |
600 KB |
OK (n = 100, answer = NO) |
19 |
Correct |
1 ms |
344 KB |
OK (n = 100, answer = YES) |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Contestant can not find answer, jury can |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
348 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
0 ms |
440 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
348 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
0 ms |
344 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
1 ms |
344 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
424 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
344 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = NO) |
17 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = NO) |
18 |
Correct |
1 ms |
600 KB |
OK (n = 100, answer = NO) |
19 |
Correct |
1 ms |
344 KB |
OK (n = 100, answer = YES) |
20 |
Incorrect |
1 ms |
348 KB |
Contestant can not find answer, jury can |
21 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
348 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
0 ms |
440 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
348 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
0 ms |
344 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
1 ms |
344 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
424 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
344 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = NO) |
17 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = NO) |
18 |
Correct |
1 ms |
600 KB |
OK (n = 100, answer = NO) |
19 |
Correct |
1 ms |
344 KB |
OK (n = 100, answer = YES) |
20 |
Incorrect |
1 ms |
348 KB |
Contestant can not find answer, jury can |
21 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
348 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
0 ms |
440 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
348 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
0 ms |
344 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
1 ms |
344 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
424 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
344 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = NO) |
17 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = NO) |
18 |
Correct |
1 ms |
600 KB |
OK (n = 100, answer = NO) |
19 |
Correct |
1 ms |
344 KB |
OK (n = 100, answer = YES) |
20 |
Incorrect |
1 ms |
348 KB |
Contestant can not find answer, jury can |
21 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
348 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
0 ms |
440 KB |
OK (n = 1, answer = YES) |
4 |
Correct |
0 ms |
348 KB |
OK (n = 2, answer = YES) |
5 |
Correct |
0 ms |
344 KB |
OK (n = 2, answer = YES) |
6 |
Correct |
1 ms |
344 KB |
OK (n = 3, answer = YES) |
7 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
8 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
9 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
10 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
11 |
Correct |
0 ms |
424 KB |
OK (n = 3, answer = YES) |
12 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
13 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = NO) |
14 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = YES) |
15 |
Correct |
0 ms |
344 KB |
OK (n = 3, answer = YES) |
16 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = NO) |
17 |
Correct |
0 ms |
348 KB |
OK (n = 3, answer = NO) |
18 |
Correct |
1 ms |
600 KB |
OK (n = 100, answer = NO) |
19 |
Correct |
1 ms |
344 KB |
OK (n = 100, answer = YES) |
20 |
Incorrect |
1 ms |
348 KB |
Contestant can not find answer, jury can |
21 |
Halted |
0 ms |
0 KB |
- |