Submission #1065432

#TimeUsernameProblemLanguageResultExecution timeMemory
1065432ReLiceSoccer Stadium (IOI23_soccer)C++17
8 / 100
4517 ms432 KiB
#include "soccer.h" #include <bits/stdc++.h> #define ll int #define pb push_back #define ins insert #define fr first #define sc second #define vll vector<ll> #define sz size() using namespace std; const ll N = 7; const ll M = N * N + 7; const ll inf = 1e9 + 7; vector<vll> f; ll n; bool ok(ll x,ll y){ return x>=0 && x<n && y>=0 && y<n && !f[x][y]; } bool can(ll x,ll y,ll x2,ll y2){ ll a = 0; ll b = 0; ll xx = x; while(x != x2){ a += f[x][y]; b += f[x][y2]; if(x < x2) x++; else x--; } x = xx; while(y != y2){ a += f[x2][y]; b += f[x][y]; if(y < y2) y++; else y--; } if(min(a, b) == 0) return true; return false; } bool check(vll v){ for(auto i : v){ for(auto j : v){ if(i == j)continue; ll x = i / n, y = i % n; ll x2 = j / n, y2 = j % n; if(!can(x, y, x2, y2)) return false; } } return true; } int biggest_stadium(int nn, vector<vector<int>> F){ ll i; n = nn; f = F; ll ans = 0; for(ll mask=1;mask<(1ll<<(n*n));mask++){ vll cur; for(i=0;i<n*n;i++){ if(mask & (1ll<<i)) cur.pb(i); } if(check(cur)) ans = max(ans, (ll)cur.sz); } return ans; }
#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...