# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
635753 | tvladm2009 | Bootfall (IZhO17_bootfall) | C++14 | 389 ms | 5668 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 <iostream>
using namespace std;
const int MAX_N = 500;
const int MOD = 1e9 + 7;
int a[MAX_N + 1], dp[MAX_N * MAX_N + 1], ways[MAX_N * MAX_N + 1], ways2[MAX_N * MAX_N + 1], cnt[MAX_N * MAX_N + 1], aux[MAX_N * MAX_N + 1];
int n;
void addSelf(int &a, int b) {
a += b;
if (a >= MOD) {
a -= MOD;
}
}
bool hentai(int pos) {
int s = 0;
for (int i = 1; i <= n; i++) {
if (i != pos) {
s += a[i];
}
}
if (pos == 0) {
dp[0] = true;
ways[0] = 1;
for (int i = 1; i <= n; i++) {
for (int j = s; j >= a[i]; j--) {
dp[j] |= dp[j - a[i]];
addSelf(ways[j], ways[j - 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... |