Submission #840558

#TimeUsernameProblemLanguageResultExecution timeMemory
840558ogkostyaSoccer Stadium (IOI23_soccer)C++17
6 / 100
285 ms31628 KiB
#include "soccer.h"

int biggest_stadium(int N, std::vector<std::vector<int>> F)
{
    int x, y;
    int c = 0;

    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < N; j++)
        {
            if (F[i][j] == 1)
            {
                c++;
                x = i;
                y = j;
            }
        }
    }

    if (c == 1)
    {
        return std::max(std::max(N * N - (x + 1) * (y + 1), N * N - (N - x) * (y + 1)), std::max(N * N - (x + 1) * (N - y), N * N - (N - x) * (N - y)));
    }

    return N * N - c;
}
#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...