QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#162288 | #7120. Soccer | yzy1 | 0 | 31ms | 468492kb | C++17 | 3.9kb | 2023-09-03 07:46:13 | 2024-04-28 06:50:52 |
Judging History
answer
#include <bits/stdc++.h>
#include "soccer.h"
#if defined(LOCAL)
#define DBG_MACRO_NO_WARNING
#include <dbg.hpp>
#include "grader.cpp"
#else
#define dbg(x...) (0)
#endif
using namespace std;
using ll = long long;
// #define int ll
#define rep(i, f, t) for (int i = (f), ed##i = (t); i <= ed##i; ++i)
#define re(i, t) rep (i, 1, t)
#define per(i, t, f) for (int i = (t), ed##i = (f); i >= ed##i; --i)
#define ste(i, f, t, s) for (int i = (f), ed##i = (t); i <= ed##i; i += s)
#define nxt(i, f, g) for (int i = g.h[f]; i; i = g.e[i].n)
#define umod(x) ((x) >= mo && ((x) -= mo))
#define dmod(x) ((x) < 0 && ((x) += mo))
#define y1 y1__
#define fio(x) (freopen(x ".in", "r", stdin), freopen(x ".out", "w", stdout))
template <class T, class E>
__attribute__((always_inline)) inline void up(T &x, E &&y) {
if (x < y) x = y;
}
template <class T, class E>
__attribute__((always_inline)) inline void down(T &x, E &&y) {
if (y < x) x = y;
}
namespace qingwa {
const int N = 2009;
const int M = 309;
const int inf = 1e9 + 7;
int n, a[N][N], dp[M][M][M][2], mx[M][M][M][2], Mx[M][M][2], Mx2[M][M][2];
inline int Main() {
memset(mx, ~0x3f, sizeof mx);
memset(dp, ~0x3f, sizeof dp);
memset(Mx, ~0x3f, sizeof Mx);
memset(Mx2, ~0x3f, sizeof Mx2);
re (i, n)
re (j, n) a[i][j] += a[i][j - 1];
int ans = 0;
re (i, n) {
if (i != 1) continue;
rep (l, 0, n + 1)
rep (r, 0, n + 1) mx[i + 1][l][r][0] = mx[i][l][r][1] = Mx[l][r][0] = Mx[l][r][1] = 0;
per (j, i, 1) {
re (l, n)
rep (r, l, n) {
dp[j][l][r][0] = mx[j + 1][l][r][0] + ((a[j][r] - a[j][l - 1]) ? -inf : r - l + 1);
// cerr << "dpup " << j << ' ' << l << ' ' << r << ' ' << dp[j][l][r][0] << '\n';
up(Mx[l][r][0], dp[j][l][r][0]);
}
per (len, n, 1)
re (l, n) {
int r = l + len - 1;
if (r > n) break;
mx[j][l][r][0] = max({mx[j][l - 1][r][0], mx[j][l][r + 1][0], dp[j][l][r][0]});
}
}
rep (j, i + 1, n) {
re (l, n)
rep (r, l, n) {
dp[j][l][r][1] = mx[j - 1][l][r][1] + ((a[j][r] - a[j][l - 1]) ? -inf : r - l + 1);
// cerr << "dpdown " << j << ' ' << l << ' ' << r << ' ' << dp[j][l][r][1] << '\n';
up(Mx[l][r][1], dp[j][l][r][1]);
}
per (len, n, 1)
re (l, n) {
int r = l + len - 1;
if (r > n) break;
mx[j][l][r][1] = max({mx[j][l - 1][r][1], mx[j][l][r + 1][1], dp[j][l][r][1]});
}
}
re (len, n)
re (l, n) {
int r = l + len - 1;
if (r > n) break;
rep (b, 0, 1) Mx2[l][r][b] = max({Mx2[l + 1][r][b], Mx2[l][r - 1][b], Mx[l][r][b]});
}
re (l, n)
rep (r, l, n) {
up(ans, Mx[l][r][0] + Mx2[l][r][1]);
up(ans, Mx2[l][r][0] + Mx[l][r][1]);
}
}
return ans;
// re (i, n) {
// int t = i & 1;
// re (l, n)
// rep (r, l, n) {
// dp[t][l][r][0] = mx[!t][l][r][0] + ((a[i][r] - a[i][l - 1]) ? -inf : r - l + 1);
// dp[t][l][r][1] = mx[!t][l][r][1] + ((a[i][r] - a[i][l - 1]) ? -inf : r - l + 1);
// up(ans, dp[t][l][r][0]);
// up(ans, dp[t][l][r][1]);
// }
// re (len, n)
// re (l, n) {
// int r = l + len - 1;
// if (r > n) break;
// // if(a[])
// mx[t][l][r][0] = max({mx[t][l + 1][r][0], mx[t][l][r - 1][0], dp[t][l][r][0]});
// }
// per (len, n, 1)
// re (l, n) {
// int r = l + len - 1;
// if (r > n) break;
// mx[t][l][r][1] =
// max({mx[t][l - 1][r][1], mx[t][l][r + 1][1], dp[t][l][r][0], dp[t][l][r][1]});
// }
// }
// return ans;
}
} // namespace qingwa
int biggest_stadium(int N, std::vector<std::vector<int>> F) {
using namespace qingwa;
n = N;
rep (i, 0, n - 1)
rep (j, 0, n - 1) a[i + 1][j + 1] = F[i][j];
return qingwa::Main();
}
详细
Subtask #1:
score: 0
Runtime Error
Test #1:
score: 6
Accepted
time: 31ms
memory: 467300kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 1 0
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 1
result:
ok ok
Test #2:
score: 6
Accepted
time: 27ms
memory: 467656kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 0 0 1 0 0 0 0
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 5
result:
ok ok
Test #3:
score: 1.5
Acceptable Answer
time: 31ms
memory: 467384kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 9847
result:
points 0.250 partial
Test #4:
score: 0
Runtime Error
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
result:
Subtask #2:
score: 0
Wrong Answer
Test #10:
score: 8
Accepted
time: 11ms
memory: 467356kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 0 0 1 0 0 1 1
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 5
result:
ok ok
Test #11:
score: 8
Accepted
time: 24ms
memory: 467376kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 0 0 1 1 0 0 1
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 5
result:
ok ok
Test #12:
score: 8
Accepted
time: 20ms
memory: 468288kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 1 0 0 0 1 1 0
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 5
result:
ok ok
Test #13:
score: 8
Accepted
time: 19ms
memory: 468076kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 1 0 0 1 0 1 0 0 1
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 4
result:
ok ok
Test #14:
score: 8
Accepted
time: 16ms
memory: 467604kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 1 0 0 0 1 0 0
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 6
result:
ok ok
Test #15:
score: 0
Wrong Answer
time: 24ms
memory: 468492kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 1 0 0 1 0 0 0
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 6
result:
wrong answer wrong
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Skipped
Dependency #3:
0%
Subtask #5:
score: 0
Skipped
Dependency #4:
0%
Subtask #6:
score: 0
Skipped
Dependency #1:
0%