# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1175044 | FZ_Laabidi | Detecting Molecules (IOI16_molecules) | C++20 | 0 ms | 328 KiB |
#include "molecules.h"
using namespace std;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
int sum =0;
sort(w.begin(), w.end());
for(int i: w)sum+=i;
int n = w.size();
vector<bool> poss(u+1, false);
poss[0]= true;
vector<vector<int>> dp(u+1);
for(int i=0; i<n; i++){
for(int j=u; j>=w[i]; j--){
if(poss[j-w[i]]){
poss[j]= true;
dp[j]= dp[j-w[i]];
dp[j].push_back(w[i]);
}
}
}
for(int i=l; i<=u; i++){
if(!dp[i].empty())return dp[i];
}
return {};
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |