이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "soccer.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 10;
int n;
vector<vector<int>> a;
int Count(int ty , int x , int y)
{
int res = 0;
if(ty == 0)
{
for(int i = 0 ; i <= x ; i++) for(int j = 0 ; j <= y ; j++)
res += (1 - a[i][j]);
}
else if(ty == 1)
{
for(int i = 0 ; i <= x ; i++) for(int j = y ; j < n ; j++)
res += (1 - a[i][j]);
}
else if(ty == 2)
{
for(int i = x ; i < n ; i++) for(int j = 0 ; j <= y ; j++)
res += (1 - a[i][j]);
}
else
{
for(int i = x ; i < n ; i++) for(int j = y ; j < n ; j++)
res += (1 - a[i][j]);
}
return res;
}
int biggest_stadium(int nn, vector<std::vector<int>> F)
{
n = nn;
a = F;
int ans = n * n;
for(int i = 0 ; i < n ; i++) for(int j = 0 ; j < n ; j++) if(a[i][j] == 1)
{
ans--;
int tmp = n * n;
for(int ty = 0 ; ty < 4 ; ty++)
tmp = min(tmp , Count(ty , i , j));
ans -= tmp;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |