# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
841784 | ntannn | 축구 경기장 (IOI23_soccer) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
//#pragma GCC optimize("O3,unroll-loops,no-stack-protector")
//#pragma GCC target("sse4,avx2,fma")
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ii> vii;
typedef vector<vi> vvi;
const int N = 1e6+10;
const ll MOD = 1e9+7;
int n;
vvi a;
void solve() {
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
if(a[i][j] == 1) {
return cout << n*n - min({(i+1)*(j+1), (i+1)*(n-j), (n-i)*(j+1), (n-i)*(n-j)}), void();
}
}
}
cout << n*n;
}
void init() {
cin >> n;
for(int i = 0; i < n; i++) {
vi temp;
temp.resize(n);
for(int j = 0; j < n; j++)
cin >> temp[j];
a.eb(temp);
}
}
#define task "a"
signed main() {
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
if(fopen(task".inp","r")) {
freopen(task".inp","r",stdin);
freopen(task".out","w",stdout);
}
int test_case = 1;
//cin >> test_case;
while(test_case--) {
init();
solve();
}
}