QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#162286#7120. Socceryzy10 2ms14352kbC++173.8kb2023-09-03 07:42:452024-04-28 06:50:47

Judging History

你现在查看的是最新测评结果

  • [2024-04-28 06:50:47]
  • 管理员手动重测本题所有提交记录
  • 测评结果:0
  • 用时:2ms
  • 内存:14352kb
  • [2023-09-03 07:42:46]
  • 评测
  • 测评结果:0
  • 用时:3ms
  • 内存:14376kb
  • [2023-09-03 07:42:45]
  • 提交

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() {
  re (i, n)
    re (j, n) a[i][j] += a[i][j - 1];
  int ans = 0;
  re (i, n) {
    if (i != 2) 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
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 6144kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
1
0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
0

result:

wrong answer wrong

Subtask #2:

score: 0
Wrong Answer

Test #10:

score: 2
Acceptable Answer
time: 0ms
memory: 14340kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 1 0
0 1 1

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
4

result:

points 0.250 partial

Test #11:

score: 8
Accepted
time: 2ms
memory: 14048kb

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: 2ms
memory: 12016kb

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: 0ms
memory: 14352kb

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: 0ms
memory: 14072kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 1
0 0 0
1 0 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
6

result:

ok ok

Test #15:

score: 8
Accepted
time: 0ms
memory: 11952kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 1
0 0 1
0 0 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
7

result:

ok ok

Test #16:

score: 8
Accepted
time: 2ms
memory: 14000kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 0 0
0 0 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
9

result:

ok ok

Test #17:

score: 2
Acceptable Answer
time: 0ms
memory: 14044kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
1 0 0
0 1 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
5

result:

points 0.250 partial

Test #18:

score: 0
Wrong Answer
time: 0ms
memory: 14044kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 1
1 1 1
0 1 1

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
3

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%