QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#179063#7120. Soccerzhoukangyang#0 18ms99760kbC++111.9kb2023-09-14 17:23:042024-04-28 07:44:52

Judging History

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

  • [2024-04-28 07:44:52]
  • 管理员手动重测本题所有提交记录
  • 测评结果:0
  • 用时:18ms
  • 内存:99760kb
  • [2023-09-14 17:23:04]
  • 评测
  • 测评结果:0
  • 用时:23ms
  • 内存:100228kb
  • [2023-09-14 17:23:04]
  • 提交

answer

#include<bits/stdc++.h>
#define L(i, j, k) for(int i = (j); i <= (k); i++)
#define R(i, j, k) for(int i = (j); i >= (k); i--)
#define ll long long
#define ull unsigned long long 
#define sz(a) ((int) a.size())
#define vi vector<int>
#define me(a, x) memset(a, x, sizeof(a))
using namespace std;
const int N = 2007;

int n;

struct node {
	int l, r, v;
};

int lst[N][N];
vector < node > f[N][N]; 

int biggest_stadium(int N, vector < vi > F) {
	L(i, 0, N - 1) {
		int l = 0;
		L(j, 0, N) {
			if(j == N || F[i][j] == 1) {
				if(l < j) {
					node qwq;
					qwq.l = l;
					qwq.r = j - 1;
					qwq.v = qwq.r - qwq.l + 1; 
					f[i][i].emplace_back(qwq);
				}
				l = j + 1;
			}
			if(j < N) lst[i][j] = l;
		}
	}
	
	int ans = 0;
	L(len, 1, N) {
		L(l, 0, N - len) {
			int r = l + len - 1;
			for(auto &o : f[l][r]) {
				ans = max(ans, o.v);
				int tl = o.l;
				int tr = o.r;
				
				int nl = l;
				int nr = r;
				while(nl > 0 && lst[nl - 1][tr] <= tl) --nl;
				while(nr < N - 1 && lst[nr + 1][tr] <= tl) ++nr;
				
				if(nl != l || nr != r) {
					o.v += ((nr - nl) - (r - l)) * (tr - tl + 1);
					f[nl][nr].emplace_back(o);
					continue;
				}
				
				if(nl > 0) {
					for(int r = tr, l; r >= tl; r = l - 2) {
						l = max(tl, lst[nl - 1][r]);
						cout << l << ' ' << r << endl;
						if(l > r) continue;
						node to;
						to.l = l, to.r = r, to.v = o.v + r - l + 1;
						f[nl - 1][nr].emplace_back(to);
					}
				}
				
				if(nr < N - 1) {
					for(int r = tr, l; r >= tl; r = l - 2) {
						l = max(tl, lst[nr + 1][r]);
						if(l > r) continue;
						node to;
						to.l = l, to.r = r, to.v = o.v + r - l + 1;
						f[nl][nr + 1].emplace_back(to);
					}
				}
			}
		}
	}
	return ans;
}

//int main() {
//	cout << biggest_stadium(5, {vi{0, 0, 0, 0, 0}, 
// vi{1, 0, 0, 0, 0}, 
// vi{0, 0, 0, 0, 0}, 
// vi{0, 0, 0, 0, 0}, 
// vi{0, 0, 1, 0, 0}});
//}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 6
Accepted
time: 15ms
memory: 99224kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
1
0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
1

result:

ok ok

Test #2:

score: 0
Wrong Answer
time: 11ms
memory: 99760kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 1 0
0 0 0

output:

2 2
0 0
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
5

result:

wrong answer secret mismatch

Subtask #2:

score: 0
Wrong Answer

Test #10:

score: 8
Accepted
time: 18ms
memory: 98628kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 1 0
0 1 1

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
5

result:

ok ok

Test #11:

score: 0
Wrong Answer
time: 11ms
memory: 98912kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 1 1
0 0 1

output:

2 1
0 0
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
5

result:

wrong answer secret mismatch

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%