# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
36869 | JustInCase | Bootfall (IZhO17_bootfall) | C++14 | 436 ms | 5800 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 endl '\n'
using namespace std;
const int MAX_N = 505;
const int MAX_SUM = 500 * 500 + 5;
int a[MAX_N], dp[MAX_SUM], aux[MAX_SUM], cntOkWith[MAX_SUM];
int main() {
//ios_base::sync_with_stdio(false);
//cin.tie(nullptr);
int n;
cin >> n;
int sum = 0;
dp[0] = 1;
for(int i = 0; i < n; i++) {
cin >> a[i];
for(int j = sum; j >= 0; j--) {
dp[j + a[i]] += dp[j];
}
sum += a[i];
}
if(sum % 2 != 0 || dp[sum / 2] == 0) {
cout << 0 << endl;
# | 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... |