Submission #1069469

#TimeUsernameProblemLanguageResultExecution timeMemory
1069469pccSoccer Stadium (IOI23_soccer)C++17
48 / 100
30 ms14356 KiB
#include "soccer.h" #include <bits/stdc++.h> using namespace std; #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,popcnt,sse4") const int mxn = 33; int N; int dp[mxn][mxn][mxn][mxn]; int biggest_stadium(int NN, std::vector<std::vector<int>> F){ N = NN; memset(dp,-1,sizeof(dp)); for(int i = 0;i<N;i++){ for(int j = 0;j<N;j++){ for(int k = j;k<N;k++){ if(F[i][k])break; dp[i][i][j][k] = k-j+1; } } } for(int wid = 1;wid<N;wid++){ for(int sr = 0;sr+wid<N;sr++){ int er = sr+wid; for(int l = 0;l<N;l++){ for(int r = l;r<N;r++){ for(int tl = l;tl<=r;tl++){ for(int tr = tl;tr<=r;tr++){ if(dp[sr+1][er][l][r] != -1&&dp[sr][sr][tl][tr] != -1) dp[sr][er][tl][tr] = max(dp[sr][er][tl][tr],dp[sr+1][er][l][r]+dp[sr][sr][tl][tr]); if(dp[sr][er-1][l][r] != -1&&dp[er][er][tl][tr] != -1) dp[sr][er][tl][tr] = max(dp[sr][er][tl][tr],dp[sr][er-1][l][r]+dp[er][er][tl][tr]); } } } } } } int ans = 0; for(auto &i:dp)for(auto &j:i)for(auto &ii:j)for(auto &jj:ii)ans = max(ans,jj); 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...