| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 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;
}
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
