Submission #1070074

# Submission time Handle Problem Language Result Execution time Memory
1070074 2024-08-22T11:28:48 Z MohamedFaresNebili Soccer Stadium (IOI23_soccer) C++17
0 / 100
1 ms 348 KB
    #include <bits/stdc++.h>
    #include "soccer.h"
     
            using namespace std;
     
            const int nx[4] = {0, 0, 1, -1}, ny[4] = {1, -1, 0, 0};
     
            int biggest_stadium(int N, vector<vector<int>> F) {
                int res = 0;
                for(int l = 0; l < N; l++) {
                    for(int i = 0; i < N; i++) {
                        if(F[l][i] == 1) continue;
                        int cur = 0;
                        queue<pair<int, int>> Q;
                        Q.push({l,i});
                        while(!Q.empty()) {
                            int X = Q.front().first, Y = Q.front().second; Q.pop();
                            if(F[X][Y]) continue;
                            ++cur; F[X][Y] = 1;
                            for(int j = 0; j < 4; j++) {
                                int x = X + nx[j], y = Y + ny[j];
                                if(x == N || x < 0 || y == N || y < 0) continue;
                                if(F[x][y]) continue;
                                Q.push({x, y});
                            }
                        }
                        res = max(res, cur);
                    }
                }
                return res;
            }
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB ok
2 Correct 0 ms 348 KB ok
3 Correct 1 ms 348 KB ok
4 Correct 0 ms 348 KB ok
5 Correct 0 ms 348 KB ok
6 Incorrect 0 ms 348 KB wrong
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB ok
2 Correct 0 ms 348 KB ok
3 Incorrect 0 ms 348 KB wrong
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB wrong
2 Halted 0 ms 0 KB -