#include <bits/stdc++.h>
#include "molecules.h"
using namespace std;
const int maxn = 1e4 + 10;
int n;
int bio[maxn];
vector<int> find_subset(int l, int u, vector<int> w) {
n = w.size();
bio[0] = 0;
for(int i = 0; i < n; i++){
for(int j = maxn - 1; j >= 0; j--){
if(bio[j] != -1 && j + w[i] <= u && bio[j + w[i]] == -1){
bio[j + w[i]] = i + 1;
}
}
}
int x = 0;
for(int i = l; i <= u; i++){
if(bio[i]){
x = i;
break;
}
}
vector <int> v;
while(x){
v.push_back(bio[x]);
x -= w[bio[x]];
}
reverse(v.begin(), v.end());
return v;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
1 ms |
344 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Contestant can not find answer, jury can |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
1 ms |
344 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
1 ms |
344 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
1 ms |
344 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
2 |
Correct |
0 ms |
348 KB |
OK (n = 1, answer = NO) |
3 |
Incorrect |
1 ms |
344 KB |
Contestant can not find answer, jury can |
4 |
Halted |
0 ms |
0 KB |
- |