# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
36951 | nickyrio | Bootfall (IZhO17_bootfall) | C++14 | 1000 ms | 23024 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = a; i<= b; ++i)
#define FORD(i, a, b) for (int i = a; i>=b; --i)
#define REP(i, a) for (int i = 0; i<a; ++i)
#define N 555
#define pp pair<int, int>
#define bit(S, i) (((S) >> i) & 1)
#define IO cin.tie(NULL);cout.tie(NULL);
#define taskname "BOOTFALL"
using namespace std;
int n, a[N];
vector<int> res;
bitset<N * N> dp[N];
int main() {
// freopen(taskname".inp","r",stdin);
// freopen(taskname".out","w",stdout);
IO;
scanf("%d", &n);
int all = 0;
FOR(i, 1, n) scanf("%d", &a[i]);
FOR(i, 1, n) all += a[i];
FOR(banned, 0, n) {
dp[banned].set(0);
int total = 0;
FOR(i, 1, n) if (i != banned) {
total += a[i];
FORD(S, total, a[i]) {
if (dp[banned][S - a[i]]) {
dp[banned].set(S);
Compilation message (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... |