# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
36161 | cheater2k | Bootfall (IZhO17_bootfall) | C++14 | 496 ms | 5164 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>
using namespace std;
const int N = 505;
const int MAX = N * N;
int n, a[N];
int sum;
int dp[MAX]; // knapsack
int tmp[MAX]; // for solve(pos)
int check[MAX];
void solve(int pos) {
for (int i = 0; i <= sum; ++i) tmp[i] = dp[i];
for (int i = 0; i <= sum; ++i) {
// we do not use a[pos]
if (i >= a[pos]) {
tmp[i] -= tmp[i - a[pos]];
}
}
for (int i = 0; i <= sum; ++i) {
if (tmp[i] != 0 && a[pos] + 2 * i - sum >= 0)
check[a[pos] + 2 * i - sum]++;
}
}
int main() {
ios_base::sync_with_stdio(false); cin.tie(0);
cin >> n;
for (int i = 1; i <= n; ++i) cin >> a[i];
# | 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... |