| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1367636 | mariza | Detecting Molecules (IOI16_molecules) | C++20 | 101 ms | 98240 KiB |
#include "molecules.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int> find_subset(int l, int r, vector<int> a) {
ll n=a.size();
bool ans[n+1][l]={};
for(ll i=n-1; i>=0; i--){
for(ll x=0; x<l; x++){
if(x+a[i]>r) ans[i][x]=ans[i+1][x];
else if(x+a[i]>=l) ans[i][x]=1;
else ans[i][x]=ans[i+1][x]|ans[i+1][x+a[i]];
}
}
if(!ans[0][0]) return vector<int>();
else{
vector<int> s;
ll x=0;
for(ll i=0; i<n; i++){
if(x+a[i]<=r && (x+a[i]>=l || ans[i+1][x+a[i]]==1)){
s.push_back(i);
x+=a[i];
}
if(x>=l) break;
}
return s;
}
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
