| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1344075 | sdan | Detecting Molecules (IOI16_molecules) | C++20 | 1096 ms | 12868 KiB |
#include "molecules.h"
#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pb push_back
const int N = 1e4+1;
vector<int> find_subset(int l, int r, vector<int> w) {
int n = w.size(), sum = 0;
vector<pair<int, int>> a;
vector<bitset<N>> dp(N);
for(int i = 0; i < n; ++i) a.pb({w[i], i});
sort(a.begin(), a.end());
for(int i = 0; i < l; ++i) {
if(i > 0 && dp[i] == 0) continue;
for(int j = 0; j < n; ++j) {
if(dp[i][j] || dp[i + a[j].f] != 0) continue;
dp[i + a[j].f] = dp[i];
dp[i + a[j].f][j] = 1;
}
}
for(int i = l; i <= r; ++i)
if(dp[i] != 0) {
vector<int> s;
for(int j = 0; j < n; ++j)
if(dp[i][j]) s.pb(a[j].s);
return s;
}
return {};
}| # | 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... | ||||
