#include <bits/stdc++.h>
#define N 1000009
#define pii pair <int, int>
#define ff first
#define sz() size()
#define ss second
#define pb push_back
#define ll long long
using namespace std;
int c[N], a[N], n;
vector<int> ans;
vector<int> find_subset(int l, int r, vector<int> v){
n=v.sz();
c[0]=1;
for(int i=0; i<n; i++){
for(int j=r; j>=0; j--){
if(c[j]){
c[j+v[i]]=1;
if(!a[j+v[i]])a[j+v[i]]=i;
}
}
}
for(int i=l; i<=r; i++){
if(c[i]){
int x;
int y=i;
while(y>0)
x=a[y], ans.pb(x), y-=v[x];
break;
}
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
384 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
0 ms |
256 KB |
OK (n = 1, answer = YES) |
4 |
Incorrect |
0 ms |
384 KB |
item #1 is taken twice |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
item #1 is taken twice |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
384 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
0 ms |
256 KB |
OK (n = 1, answer = YES) |
4 |
Incorrect |
0 ms |
384 KB |
item #1 is taken twice |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
384 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
0 ms |
256 KB |
OK (n = 1, answer = YES) |
4 |
Incorrect |
0 ms |
384 KB |
item #1 is taken twice |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
384 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
0 ms |
256 KB |
OK (n = 1, answer = YES) |
4 |
Incorrect |
0 ms |
384 KB |
item #1 is taken twice |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
384 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
1 ms |
384 KB |
OK (n = 1, answer = NO) |
3 |
Correct |
0 ms |
256 KB |
OK (n = 1, answer = YES) |
4 |
Incorrect |
0 ms |
384 KB |
item #1 is taken twice |
5 |
Halted |
0 ms |
0 KB |
- |