Submission #1056234

#TimeUsernameProblemLanguageResultExecution timeMemory
1056234perekopskadSoccer Stadium (IOI23_soccer)C++17
6 / 100
230 ms31772 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define el '\n' #define ff first #define ss second #define pii pair <ll, ll> #define pb push_back #define mkp make_pair #define fr(i, l, r) for(ll i = l; i <= r; i++) #define debug(x) \ { cout << #x << " = " << x << el; } template<class T, class S> inline bool chmax(T &a, const S &b) { return (a < b ? a = b, 1 : 0); } template<class T, class S> inline bool chmin(T &a, const S &b) { return (a > b ? a = b, 1 : 0); } const ll N = 2e3 + 10; const ll M = 1e5 + 10; const ll K = 400; const ll INF = 1e18 + 10; const ll inf = 1e9 + 10; const ll LOG = 20; const ll mod = 1000002022; mt19937 rnd(time(0)); /* 5 0 0 0 1 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 */ int biggest_stadium(int N, std::vector<std::vector<int>> F) { ll ans = N * N; fr(i, 0, N - 1) { fr(j, 0, N - 1) { if(F[i][j]) { ll x = min(i + 1, N - i); ll y = min(j + 1, N - j); chmin(ans, N * N - x * y); } } } return ans; } /* int main() { int N; assert(1 == scanf("%d", &N)); std::vector<std::vector<int>> F(N, std::vector<int>(N)); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { assert(1 == scanf("%d", &F[i][j])); } } fclose(stdin); int res = biggest_stadium(N, F); printf("%d\n", res); fclose(stdout); return 0; } */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...