| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 232416 | UserIsUndefined | Detecting Molecules (IOI16_molecules) | C++14 | 603 ms | 65540 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "molecules.h"
using namespace std;
map<pair<int,int> , bool> dp;
std::vector<int> find_subset(int l, int u, std::vector<int> w) {
int n = w.size();
for (int i = 0 ; i <= n ; i++){
dp[{i,0}] = true;
}
for (int j = 0 ; j <= u ; j++){
for (int i = 0 ; i < n ; i++){
if (w[i] <= j)dp[{i+1,j}]|= dp[{i,j - w[i]}];
dp[{i+1,j}]|= dp[{i,j}];
}
}
int k = -1;
for (int i = l ; i <= u ; i++){
if (dp[{n,i}]){
k = i;
break;
}
}
vector<int> ans;
if (k == -1)return ans;
for (int i = n ; i >= 1 ; i--){
if (dp[{i-1,k - w[i - 1]}]){
ans.push_back(i - 1);
k-= w[i-1];
if (k == 0)return ans;
}
}
return ans;
}| # | 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... | ||||
