QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#162288#7120. Socceryzy10 27ms468340kbC++173.9kb2023-09-03 07:46:132023-09-03 07:46:13

Judging History

你现在查看的是测评时间为 2023-09-03 07:46:13 的历史记录

  • [2024-04-28 06:50:52]
  • 管理员手动重测本题所有提交记录
  • 测评结果:0
  • 用时:31ms
  • 内存:468492kb
  • [2023-09-03 07:46:13]
  • 评测
  • 测评结果:0
  • 用时:27ms
  • 内存:468340kb
  • [2023-09-03 07:46:13]
  • 提交

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: 3ms
memory: 467404kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
1
0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
1

result:

ok ok

Test #2:

score: 6
Accepted
time: 27ms
memory: 467708kb

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: 16ms
memory: 468004kb

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: 20ms
memory: 467100kb

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: 20ms
memory: 466932kb

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: 16ms
memory: 466716kb

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: 20ms
memory: 467536kb

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: 20ms
memory: 468340kb

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: 11ms
memory: 468000kb

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%