제출 #937264

#제출 시각아이디문제언어결과실행 시간메모리
937264Dan4Life축구 경기장 (IOI23_soccer)C++17
0 / 100
2 ms604 KiB
#include "soccer.h" #include <bits/stdc++.h> using namespace std; #define pf push_front #define pb push_back #define ll long long #define vi vector<int> #define sz(a) (int)a.size() #define all(a) begin(a),end(a) vector<array<int,2>> v; int n, a[10][10]; int recur(int pos){ if(pos==sz(v)){ int tot = 0; for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) if(!a[i][j]) tot++; return tot; } if(a[v[pos][0]][v[pos][1]]) return recur(pos+1); int ans = 0; for(int i = 0; i <= v[pos][0]; i++) for(int j = 0; j <= v[pos][1]; j++) a[i][j]++; ans = max(ans, recur(pos+1)); for(int i = 0; i <= v[pos][0]; i++) for(int j = 0; j <= v[pos][1]; j++) a[i][j]--; for(int i = 0; i <= v[pos][0]; i++) for(int j = v[pos][1]; j < n; j++) a[i][j]++; ans = max(ans, recur(pos+1)); for(int i = 0; i <= v[pos][0]; i++) for(int j = v[pos][1]; j < n; j++) a[i][j]--; for(int i = v[pos][0]; i < n; i++) for(int j = 0; j <= v[pos][1]; j++) a[i][j]++; ans = max(ans, recur(pos+1)); for(int i = v[pos][0]; i < n; i++) for(int j = 0; j <= v[pos][1]; j++) a[i][j]--; for(int i = v[pos][0]; i < n; i++) for(int j = v[pos][1]; j < n; j++) a[i][j]++; ans = max(ans, recur(pos+1)); for(int i = v[pos][0]; i < n; i++) for(int j = v[pos][1]; j < n; j++) a[i][j]--; return ans; } int biggest_stadium(int N, vector<vi> F) { n = N; v.clear(); for(int i = 0; i < N; i++) for(int j = 0; j < N; j++) if(F[i][j]) v.pb({i,j}); return recur(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...