#include<bits/stdc++.h>
#include "molecules.h"
using namespace std;
vector<signed> find_subset(signed l, signed u, vector<signed> w) {
int N = w.size();
vector<int> dp (10001,-1);
dp[0] = -2;
for(int i = 0; i < N; i++){
for(int j = 10001; j >= w[i]; j--){
if(dp[j-w[i]] != -1){
dp[j] = i;
}
}
}
for(int i = l; i <= u; i++){
if(dp[i] != -1){
vector<signed> res;
int idx = i;
while(1){
res.push_back(dp[idx]);
idx -= w[dp[idx]];
if(idx == 0) break;
}
return res;
}
}
return {};
}
# |
결과 |
실행 시간 |
메모리 |
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 |
1 ms |
384 KB |
OK (n = 1, answer = YES) |
4 |
Incorrect |
1 ms |
384 KB |
item #1 is taken twice |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
item #11 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 |
1 ms |
384 KB |
OK (n = 1, answer = YES) |
4 |
Incorrect |
1 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 |
1 ms |
384 KB |
OK (n = 1, answer = YES) |
4 |
Incorrect |
1 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 |
1 ms |
384 KB |
OK (n = 1, answer = YES) |
4 |
Incorrect |
1 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 |
1 ms |
384 KB |
OK (n = 1, answer = YES) |
4 |
Incorrect |
1 ms |
384 KB |
item #1 is taken twice |
5 |
Halted |
0 ms |
0 KB |
- |