QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#217455#7120. Soccerhocky#0 12ms8740kbC++141.6kb2023-10-16 21:17:502024-04-28 07:53:19

Judging History

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

  • [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: 3868kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
1
0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
1

result:

ok ok

Test #2:

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

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: 4328kb

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: 12ms
memory: 8740kb

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: 3780kb

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

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: 4076kb

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: 4108kb

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: 3784kb

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: 3808kb

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

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

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%