Submission #1001050

# Submission time Handle Problem Language Result Execution time Memory
1001050 2024-06-18T13:41:11 Z 변재우(#10901) Soccer Stadium (IOI23_soccer) C++17
8 / 100
4500 ms 412 KB
#include "soccer.h"
#include <bits/stdc++.h>
using namespace std;

int ans, X[5][5], Y[5][5];

int biggest_stadium(int N, std::vector<std::vector<int>> F)
{
    for(int i=1; i<=N; i++) for(int j=1; j<=N; j++)
        X[i][j]=X[i][j-1]+F[i-1][j-1], Y[i][j]=Y[i-1][j]+F[i-1][j-1];
    for(int m=0; m<(1<<(N*N)); m++) {
        vector<vector<bool>> chk;
        chk.resize(N);
        for(int i=0; i<N; i++) chk[i].resize(N);
        bool flag=true;
        for(int i=0; i<N; i++) for(int j=0; j<N; j++) if(m&(1<<(i*N+j))) {
            chk[i][j]=true;
            if(F[i][j]) flag=false;
        }
        for(int i=1; i<=N; i++) for(int j=1; j<=N; j++) {
            for(int ii=1; ii<=N; ii++) for(int jj=1; jj<=N; jj++) if(chk[i-1][j-1] && chk[ii-1][jj-1]) {
                bool a=(X[ii][max(j, jj)]-X[ii][min(j, jj)-1]+Y[max(i, ii)][j]-Y[min(i, ii)-1][j])>0;
                bool b=(X[i][max(j, jj)]-X[i][min(j, jj)-1]+Y[max(i, ii)][jj]-X[min(i, ii)-1][jj])>0;
                if(a && b) flag=false;
            }
        }
        if(flag) ans=max(ans, __builtin_popcount(m));
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 4563 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB ok
2 Correct 1 ms 344 KB ok
3 Incorrect 1204 ms 412 KB wrong
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB ok
2 Correct 1 ms 344 KB ok
3 Correct 1 ms 348 KB ok
4 Correct 1 ms 348 KB ok
5 Correct 0 ms 348 KB ok
6 Correct 0 ms 348 KB ok
7 Correct 0 ms 348 KB ok
8 Correct 0 ms 348 KB ok
9 Correct 0 ms 348 KB ok
10 Correct 0 ms 348 KB ok
11 Correct 1 ms 348 KB ok
12 Correct 1 ms 348 KB ok
13 Correct 1 ms 348 KB ok
# Verdict Execution time Memory Grader output
1 Execution timed out 4563 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4563 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4563 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4563 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -