QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#217455#7120. Soccerhocky#0 8ms8772kbC++141.6kb2023-10-16 21:17:502023-10-16 21:17:50

Judging History

你现在查看的是测评时间为 2023-10-16 21:17:50 的历史记录

  • [2024-04-28 07:53:19]
  • 管理员手动重测本题所有提交记录
  • 测评结果:0
  • 用时:12ms
  • 内存:8740kb
  • [2023-10-16 21:17:50]
  • 评测
  • 测评结果:0
  • 用时:8ms
  • 内存:8772kb
  • [2023-10-16 21:17:50]
  • 提交

answer

#include "soccer.h"

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<LL, LL> PLL;
typedef vector <int> vi;
typedef vector <vi> vvi;
#define pb push_back
#define fi first
#define se second
#define rep(i,a,b) for(int i = a;i < b;i++)
#define trav(nx, v) for(auto &nx : v)
#define all(a) begin(a), end(a)
#define sz(v) (int) v.size()

int n;
int presum[1005][1005];
void init(const vvi &stadium){
	for(int i = 0;i < n;i++){
		for(int j = 0;j < n;j++){
			presum[i + 1][j + 1] = stadium[i][j];
		}
	}
	rep(i,1,n + 1){
		rep(j,1,n + 1){
			presum[i][j] += presum[i - 1][j] + presum[i][j - 1] - presum[i - 1][j - 1];
		}
	}
}

LL query(PLL st, PLL ed){
	st.fi++; st.se++;
	ed.fi++; ed.se++;
	if(st.fi > ed.fi) return 0;
	if(st.se > ed.se) return 0;
	return (ed.fi - st.fi + 1) * (ed.se - st.se + 1);
}

typedef pair<int, int> PII;

int biggest_stadium(int N, std::vector<std::vector<int>> F){
	vvi tmp = F;
	n = N;
	init(tmp);
	PII st = {-1, -1};
	rep(i,0,n){
		rep(j,0,n){
			if(F[i][j] == 1){
				st = {i, j};
				break;
			}
		}
	}
	if(st.fi == -1) return n * n;
	vector <LL> total;
	total.pb(query({0, 0}, {n - 1, st.se - 1}) + query({0, st.se}, {st.fi - 1, n - 1}));
	total.pb(query({0, 0}, {st.fi - 1, n - 1}) + query({st.fi, st.se + 1}, {n - 1, n - 1}));
	total.pb(query({0, st.se + 1}, {n - 1, n - 1}) + query({st.fi + 1, 0}, {n - 1, st.se}));
	total.pb(query({0, 0}, {n - 1, st.se - 1}) + query({st.fi + 1, st.se}, {n - 1, n - 1}));
	//~ trav(cur, total) cout << cur << " ";
	//~ cout << endl;
	LL ans = *max_element(all(total));
	return ans;
}

詳細信息

Subtask #1:

score: 0
Runtime Error

Test #1:

score: 6
Accepted
time: 0ms
memory: 3668kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
1
0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
1

result:

ok ok

Test #2:

score: 6
Accepted
time: 1ms
memory: 3660kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 1 0
0 0 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
5

result:

ok ok

Test #3:

score: 6
Accepted
time: 1ms
memory: 4164kb

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
9850

result:

ok ok

Test #4:

score: 6
Accepted
time: 8ms
memory: 8772kb

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:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
236536

result:

ok ok

Test #5:

score: 0
Runtime Error

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
2000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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: 2
Acceptable Answer
time: 1ms
memory: 3700kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 1 0
0 1 1

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
7

result:

points 0.250 partial

Test #11:

score: 2
Acceptable Answer
time: 1ms
memory: 3656kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 1 1
0 0 1

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
8

result:

points 0.250 partial

Test #12:

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

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 1
0 0 0
1 1 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
8

result:

points 0.250 partial

Test #13:

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

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
1 0 0
1 0 1
0 0 1

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
8

result:

points 0.250 partial

Test #14:

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

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 1
0 0 0
1 0 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
8

result:

points 0.250 partial

Test #15:

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

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: 1ms
memory: 3788kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 0 0
0 0 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
9

result:

ok ok

Test #17:

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

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
1 0 0
0 1 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
7

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%