#define _CRT_SECURE_NO_WARNINGS
#include "soccer.h"
#include <iostream>
#include <string>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <sstream>
#include <map>
#include <stack>
#include <set>
#include <queue>
#include <deque>
#include <unordered_set>
#include <unordered_map>
#include <math.h>
#include <cmath>
#include <vector>
#include <iomanip>
#include <random>
#include <chrono>
#include <bitset>
#include <cassert>
using namespace std;
#define ll long long
#define fr first
#define sc second
#define pb push_back
#define US freopen(".in", "r", stdin); freopen(".out", "w", stdout);
ll gcd(ll a, ll b)
{
if (a == 0 || b == 0) {
return max(a, b);
}
if (a <= b) {
return gcd(a, b % a);
}
else {
return gcd(a % b, b);
}
}
ll lcm(ll a, ll b) {
return (a / gcd(a, b)) * b;
}
const int N = 200005;
const ll oo = 1000000000000000000, MOD = 1000000007;
int biggest_stadium(int N, std::vector<std::vector<int>> F) {
int n = N;
pair<int, int> stex = { -1,-1 };
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j){
if (F[i][j] == 1) {
stex = { i,j };
}
}
}
if (stex.fr == -1) {
return (n * n);
}
int jj = stex.sc;
int ii = stex.fr;
int ver = stex.fr - 1;
int ner = n - stex.fr;
int dzax = stex.sc - 1;
int aj = n - stex.sc;
int ans = ner * (n - aj) + n * (aj);
ans = max(ans, n * dzax + ner * (n - dzax));
ans = max(ans, n * dzax + ver * (n - dzax));
ans = max(ans, n * aj + ver * (n - aj));
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... |