# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
577808 | 2022-06-15T09:27:38 Z | kingfran1907 | Uplifting Excursion (BOI22_vault) | C++14 | 1389 ms | 127500 KB |
#include <bits/stdc++.h> #define X first #define Y second using namespace std; typedef long long llint; const int maxn = 201; const int buf = maxn * maxn; const int inf = 0x3f3f3f3f; int n; llint l; int niz[2 * maxn]; int dp[2 * maxn][2 * maxn * maxn]; int f(int x, int val) { if (x == n + 1) { if (val == l) return 0; else return -inf; } int &ret = dp[x + maxn][val + buf]; if (ret != -1) return ret; ret = -inf; for (int i = 0; i <= niz[x + n]; i++) { ret = max(ret, i + f(x + 1, val + i * x)); } return ret; } int main() { scanf("%d%lld\n", &n, &l); for (int i = 0; i < n + n + 1; i++) scanf("%d", niz+i); memset(dp, -1, sizeof dp); int out = f(-n, 0); if (out < 0) printf("impossible\n"); else printf("%d\n", out); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 51 ms | 127464 KB | Output is correct |
2 | Correct | 48 ms | 127380 KB | Output is correct |
3 | Correct | 50 ms | 127308 KB | Output is correct |
4 | Correct | 55 ms | 127312 KB | Output is correct |
5 | Correct | 492 ms | 127500 KB | Output is correct |
6 | Correct | 523 ms | 127416 KB | Output is correct |
7 | Correct | 136 ms | 127416 KB | Output is correct |
8 | Correct | 475 ms | 127420 KB | Output is correct |
9 | Incorrect | 1389 ms | 127436 KB | Output isn't correct |
10 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 51 ms | 127464 KB | Output is correct |
2 | Correct | 48 ms | 127380 KB | Output is correct |
3 | Correct | 50 ms | 127308 KB | Output is correct |
4 | Correct | 55 ms | 127312 KB | Output is correct |
5 | Correct | 492 ms | 127500 KB | Output is correct |
6 | Correct | 523 ms | 127416 KB | Output is correct |
7 | Correct | 136 ms | 127416 KB | Output is correct |
8 | Correct | 475 ms | 127420 KB | Output is correct |
9 | Incorrect | 1389 ms | 127436 KB | Output isn't correct |
10 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 47 ms | 127308 KB | Output is correct |
2 | Incorrect | 47 ms | 127308 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 47 ms | 127308 KB | Output is correct |
2 | Incorrect | 47 ms | 127308 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 47 ms | 127308 KB | Output is correct |
2 | Incorrect | 47 ms | 127308 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 51 ms | 127464 KB | Output is correct |
2 | Correct | 48 ms | 127380 KB | Output is correct |
3 | Correct | 50 ms | 127308 KB | Output is correct |
4 | Correct | 55 ms | 127312 KB | Output is correct |
5 | Correct | 492 ms | 127500 KB | Output is correct |
6 | Correct | 523 ms | 127416 KB | Output is correct |
7 | Correct | 136 ms | 127416 KB | Output is correct |
8 | Correct | 475 ms | 127420 KB | Output is correct |
9 | Incorrect | 1389 ms | 127436 KB | Output isn't correct |
10 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 47 ms | 127308 KB | Output is correct |
2 | Incorrect | 47 ms | 127308 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 51 ms | 127464 KB | Output is correct |
2 | Correct | 48 ms | 127380 KB | Output is correct |
3 | Correct | 50 ms | 127308 KB | Output is correct |
4 | Correct | 55 ms | 127312 KB | Output is correct |
5 | Correct | 492 ms | 127500 KB | Output is correct |
6 | Correct | 523 ms | 127416 KB | Output is correct |
7 | Correct | 136 ms | 127416 KB | Output is correct |
8 | Correct | 475 ms | 127420 KB | Output is correct |
9 | Incorrect | 1389 ms | 127436 KB | Output isn't correct |
10 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 47 ms | 127308 KB | Output is correct |
2 | Incorrect | 47 ms | 127308 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 51 ms | 127464 KB | Output is correct |
2 | Correct | 48 ms | 127380 KB | Output is correct |
3 | Correct | 50 ms | 127308 KB | Output is correct |
4 | Correct | 55 ms | 127312 KB | Output is correct |
5 | Correct | 492 ms | 127500 KB | Output is correct |
6 | Correct | 523 ms | 127416 KB | Output is correct |
7 | Correct | 136 ms | 127416 KB | Output is correct |
8 | Correct | 475 ms | 127420 KB | Output is correct |
9 | Incorrect | 1389 ms | 127436 KB | Output isn't correct |
10 | Halted | 0 ms | 0 KB | - |