# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
224103 | Minnakhmetov | Building 4 (JOI20_building4) | C++14 | 1916 ms | 127936 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;
#define ll long long
#define all(aaa) aaa.begin(), aaa.end()
const int N = 4005;
int dp[N][N], a[2][N], ans[N];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
for (int i = 0; i < 2; i++) {
for (int j = 0; j < n + n; j++) {
cin >> a[i][j];
}
}
memset(dp, -1, sizeof(dp));
dp[1][0] = 0;
dp[1][1] = 1;
for (int i = 1; i < n + n; i++) {
for (int j = 0; j <= n; j++) {
if (dp[i][j] != -1) {
for (int k = 0; k <= min(1, n - j); k++) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |