QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#521913 | #7120. Soccer | kimmoqt# | 1.5 | 245ms | 305020kb | C++20 | 2.3kb | 2024-08-16 16:38:48 | 2024-08-16 16:38:48 |
Judging History
answer
#include "soccer.h"
#include <bits/stdc++.h>
using namespace std;
const int MX=2005;
const int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
vector<vector<int>> F;
int N;
bool vis[MX][MX];
void dfs(int x, int y) {
vis[x][y]=true;
for(int k=0;k<4;k++) {
int nx=x+dx[k],ny=y+dy[k];
if(nx>=0 && nx<N && ny>=0 && ny<N && !vis[nx][ny]) {
dfs(nx,ny);
}
}
}
vector<int> v[MX],vv[MX];
int biggest_stadium(int N, std::vector<std::vector<int>> F) {
::N=N, ::F=F;
int cnt=0;
for(int i=0;i<N;i++) {
for(int j=0;j<N;j++) {
if(F[i][j] || vis[i][j]) continue;
dfs(i,j);
cnt++;
}
}
if(cnt>1) return 0;
for(int i=0;i<N;i++) {
for(int j=0;j<N;j++) {
if(F[i][j]) continue;
int k=j;
while(k+1<N && F[i][k+1]==0) k++;
v[i].push_back(j);
v[i].push_back(k);
j=k;
}
if(v[i].size()>2) return 0;
}
for(int j=0;j<N;j++) {
for(int i=0;i<N;i++) {
if(F[i][j]) continue;
int k=i;
while(k+1<N && F[k+1][j]==0) k++;
vv[j].push_back(i);
vv[j].push_back(k);
i=k;
}
if(vv[j].size()>2) return 0;
}
cnt=0;
for(int i=1;i+1<N;i++) {
if(v[i].empty() || v[i-1].empty() || v[i+1].empty()) continue;
if(v[i-1][0]>v[i][0] && v[i][1]<v[i+1][0]) cnt++;
}
if(cnt>0) return 0;
cnt=0;
for(int j=1;j+1<N;j++) {
if(vv[j].empty() || vv[j-1].empty() || vv[j+1].empty()) continue;
if(vv[j-1][0]>vv[j][0] && vv[j][1]<vv[j+1][1]) cnt++;
}
if(cnt>0) return 0;
int ans=0;
for(int i=0;i<N;i++) {
for(int j=0;j<N;j++) {
ans+=!F[i][j];
}
}
return ans;
}
詳細信息
Subtask #1:
score: 1.5
Acceptable Answer
Test #1:
score: 6
Accepted
time: 0ms
memory: 3848kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 1 0
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 1
result:
ok ok
Test #2:
score: 1.5
Acceptable Answer
time: 0ms
memory: 3784kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 0 0 1 0 0 0 0
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 0
result:
points 0.250 partial
Test #3:
score: 1.5
Acceptable Answer
time: 1ms
memory: 4836kb
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 0
result:
points 0.250 partial
Test #4:
score: 1.5
Acceptable Answer
time: 16ms
memory: 23408kb
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 0
result:
points 0.250 partial
Test #5:
score: 1.5
Acceptable Answer
time: 245ms
memory: 305020kb
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:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 0
result:
points 0.250 partial
Test #6:
score: 6
Accepted
time: 0ms
memory: 3932kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 9 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 80
result:
ok ok
Test #7:
score: 6
Accepted
time: 0ms
memory: 3824kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 10 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 99
result:
ok ok
Test #8:
score: 6
Accepted
time: 0ms
memory: 3840kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 0 0 0 0 0 0 1
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 8
result:
ok ok
Test #9:
score: 6
Accepted
time: 0ms
memory: 3836kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 0 0 0 0 1 0 0
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 8
result:
ok ok
Subtask #2:
score: 0
Wrong Answer
Test #10:
score: 2
Acceptable Answer
time: 0ms
memory: 3840kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 0 0 1 0 0 1 1
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 0
result:
points 0.250 partial
Test #11:
score: 2
Acceptable Answer
time: 0ms
memory: 3900kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 0 0 1 1 0 0 1
output:
xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0 OK 0
result:
points 0.250 partial
Test #12:
score: 0
Wrong Answer
time: 0ms
memory: 3840kb
input:
R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L 3 0 0 1 0 0 0 1 1 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:
25%
Acceptable Answer
Dependency #2:
0%