Submission #1059909

# Submission time Handle Problem Language Result Execution time Memory
1059909 2024-08-15T09:03:37 Z tolbi Soccer Stadium (IOI23_soccer) C++17
Compilation error
0 ms 0 KB
#include "soccer.h"
#include <bits/stdc++.h>
using namespace std;
int biggest_stadium(int N, std::vector<std::vector<int>> F)
{
    int dp[2][N][N][N]={};
    int ans = 0;
    for (int l = 0; l < N; l++){
        for (int r = l; r < N; r++){
            dp[0][N-1][l][r]=r-l+1;
            for (int i = l; i <= r; i++){
                if (F[N-1][i]==1){
                    dp[0][N-1][l][r]=0;
                    break;
                }
            }
            dp[1][N-1][l][r]=dp[0][N-1][l][r];
            ans=max(ans,dp[1][N-1][l][r]);
        }
    }
    for (int i = N-2; i >= 0; i--){
        for (int l = 0; l < N; l++){
            for (int r = N-1; r >= l; r--){
                dp[0][i][l][r]=r-l+1;
                for (int j = l; j <= r; j++){
                    if (F[i][j]==1){
                        dp[0][i][l][r]=0;
                        break;
                    }
                }
                if (dp[0][i][l][r]==0) {
                    dp[1][i][l][r]=0;
                    continue;
                }
                int cur = 0;
                int lel = l;
                for (int j = l; j <= r; j++){
                    if (F[i+1][j]==0){
                        cur=max(cur,dp[0][i+1][lel][j]);
                    }
                    else {
                        lel=j+1;
                    }
                }
                dp[0][i][l][r]+=cur;
                dp[1][i][l][r]=dp[0][i][l][r];
                if (l>0){
                    dp[1][i][l][r]=max(dp[1][i][l][r],dp[1][i][l-1][r]);
                }
                if (r+1<N){
                    dp[1][i][l][r]=max(dp[1][i][l][r],dp[1][i][l][r+1]);
                }
                dp[1][i][l][r]=max(dp[1][i][l][r],r-l+1+dp[1][i+1][l][r]);
                ans=max(ans,dp[1][i][l][r]);
            }
        }
    }
    return ans;
}

Compilation message

during RTL pass: expand
soccer.cpp: In function 'int biggest_stadium(int, std::vector<std::vector<int> >)':
soccer.cpp:6:9: internal compiler error: in make_decl_rtl, at varasm.c:1342
    6 |     int dp[2][N][N][N]={};
      |         ^~
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.