#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define pop_front(v) v.erase(v.begin())
#define REP(i, a, b) for (int i=a; i<=b; i++)
#define REPn(i, a, b) for (int i=a; i>=b; i--)
#define FOR(i, n) REP(i, 0, n-1)
#define FORn(j, n) REPn(j, n-1, 0)
#define all(v) (v).begin(), (v).end()
#define allR(v) (v).rbegin(), (v).rend()
vi solve(int l, int r, vi w, int i) {
vi aa = {};
if (i==0) return aa;
if (w[i]<=r) {
if (w[i]>=l) return {i};
vi ab = solve(l-w[i],r-w[i],w,i-1);
if (ab.size()>=1) aa.PB(i);
for (int a: ab) aa.PB(a);
} else return solve(l,r,w,i-1);
return aa;
}
vi find_subset(int l, int r, vi w) {
sort(all(w));
return solve(l,r,w,w.size()-1);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
1 ms |
364 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Contestant can not find answer, jury can |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
1 ms |
364 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
1 ms |
364 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
1 ms |
364 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
364 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
1 ms |
364 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |