Submission #1077965

#TimeUsernameProblemLanguageResultExecution timeMemory
1077965UnforgettableplSoccer Stadium (IOI23_soccer)C++17
30 / 100
1106 ms2097152 KiB
#include "soccer.h" #include <bits/stdc++.h> using namespace std; int biggest_stadium(int N,vector<vector<int>> F){ vector DP(N,vector(N,vector(N,vector(N,vector(N,vector(N,0)))))); for(int row1=N-1;row1>=0;row1--){ for(int row2=row1;row2<N;row2++){ for(int col1=0;col1<N;col1++){ for(int col2=col1;col2<N;col2++){ if(F[row1][col2])break; for(int col3=0;col3<N;col3++){ for(int col4=col3;col4<N;col4++){ if(F[row2][col4])break; if(!(col3<=col1 and col2<=col4) and !(col1<=col3 and col4<=col2))continue; if(row1==row2) { DP[row1][row2][col1][col2][col3][col4]=max(col2,col4)-min(col1,col3)+1; continue; } if(row1+1==row2) { DP[row1][row2][col1][col2][col3][col4]=col2+col4-col1-col3+2; continue; } if(col2-col1<=col4-col3) for(int col5=0;col5<=col1;col5++) { for(int col6=col2;col6<N;col6++) { DP[row1][row2][col1][col2][col3][col4]=max(DP[row1][row2][col1][col2][col3][col4],DP[row1+1][row2][col5][col6][col3][col4]+col2-col1+1); } } else for(int col5=0;col5<=col3;col5++) { for(int col6=col4;col6<N;col6++) { DP[row1][row2][col1][col2][col3][col4]=max(DP[row1][row2][col1][col2][col3][col4],DP[row1][row2-1][col1][col2][col5][col6]+col4-col3+1); } } } } } } } } int ans = 0; for(auto&i:DP) { for(auto&j:i) { for(auto&k:j) { for(auto&l:k) { for(auto&h:l) { for(auto&o:h) { ans = max(ans,o); } } } } } } 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...