Submission #861678

# Submission time Handle Problem Language Result Execution time Memory
861678 2023-10-16T16:07:20 Z faustaadp Soccer Stadium (IOI23_soccer) C++17
12 / 100
4500 ms 80976 KB
#include "soccer.h"
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
#define pb push_back
ll b[2010][2010];
int cek(int N, std::vector<std::vector<int>> F)
{
    ll sum = 0;
    for(ll i = 0; i < N; i++)
        for(ll j = 0; j < N; j++)
            sum += (1 - F[i][j]);
    ll te = 0;
    for(ll i = 0; i < N; i++)
        for(ll j = 0; j < N; j++)
        {
            if(F[i][j])continue;
            ll ha = 0;
            te++;
            for(ll k = i; k < N; k++)
            {
                if(F[k][j])break;
                for(ll l = j; l < N; l++)
                {
                    if(F[k][l])break;
                    ha += (b[k][l] != te);
                    b[k][l] = te;
                }
                for(ll l = j; l >= 0; l--)
                {
                    if(F[k][l])break;
                    ha += (b[k][l] != te);
                    b[k][l] = te;
                }
            }
            // cout << ha << "_\n";
            for(ll k = i; k >= 0; k--)
            {
                if(F[k][j])break;
                for(ll l = j; l < N; l++)
                {
                    if(F[k][l])break;
                    ha += (b[k][l] != te);
                    b[k][l] = te;
                }
                for(ll l = j; l >= 0; l--)
                {
                    if(F[k][l])break;
                    ha += (b[k][l] != te);
                    b[k][l] = te;
                }
            }

            for(ll k = j; k < N; k++)
            {
                if(F[i][k])break;
                for(ll l = i; l < N; l++)
                {
                    if(F[l][k])break;
                    ha += (b[l][k] != te);
                    b[l][k] = te;
                }
                for(ll l = i; l >= 0; l--)
                {
                    if(F[l][k])break;
                    ha += (b[l][k] != te);
                    b[l][k] = te;
                }
            }
            for(ll k = j; k >= 0; k--)
            {
                if(F[i][k])break;
                for(ll l = i; l < N; l++)
                {
                    if(F[l][k])break;
                    ha += (b[l][k] != te);
                    b[l][k] = te;
                }
                for(ll l = i; l >= 0; l--)
                {
                    if(F[l][k])break;
                    ha += (b[l][k] != te);
                    b[l][k] = te;
                }
            }
            // cout << ha << "_\n";
            if(ha != sum)
                return 0;
        }
    return sum;
}
int biggest_stadium(int N, std::vector<std::vector<int>> F)
{
    return cek(N, F);
    // for(ll i = 0; i < N; i++)
    //     for(ll j = 0; j < N; j++)
    //     {
    //         if(F[i][j])
    //         {
    //             return N * N - min(i + 1, N - i) * min(j + 1, N - j);
    //         }
    //     }
    // return N * N;
}
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 344 KB partial
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB ok
2 Correct 0 ms 348 KB ok
3 Correct 0 ms 348 KB ok
4 Correct 0 ms 348 KB ok
5 Correct 0 ms 392 KB ok
6 Partially correct 0 ms 348 KB partial
7 Partially correct 3 ms 860 KB partial
8 Partially correct 145 ms 7328 KB partial
9 Execution timed out 4573 ms 80976 KB Time limit exceeded
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB ok
2 Correct 0 ms 348 KB ok
3 Partially correct 0 ms 344 KB partial
4 Partially correct 0 ms 348 KB partial
5 Partially correct 1 ms 344 KB partial
6 Partially correct 0 ms 344 KB partial
7 Partially correct 0 ms 348 KB partial
8 Correct 0 ms 348 KB ok
9 Correct 1 ms 348 KB ok
10 Partially correct 0 ms 348 KB partial
11 Partially correct 0 ms 348 KB partial
12 Partially correct 0 ms 348 KB partial
13 Correct 0 ms 348 KB ok
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 344 KB partial
2 Correct 1 ms 348 KB ok
3 Correct 0 ms 348 KB ok
4 Partially correct 0 ms 344 KB partial
5 Partially correct 0 ms 348 KB partial
6 Partially correct 1 ms 344 KB partial
7 Partially correct 0 ms 344 KB partial
8 Partially correct 0 ms 348 KB partial
9 Correct 0 ms 348 KB ok
10 Correct 1 ms 348 KB ok
11 Partially correct 0 ms 348 KB partial
12 Partially correct 0 ms 348 KB partial
13 Partially correct 0 ms 348 KB partial
14 Correct 0 ms 348 KB ok
15 Partially correct 0 ms 348 KB partial
16 Partially correct 0 ms 348 KB partial
17 Partially correct 0 ms 348 KB partial
18 Partially correct 1 ms 348 KB partial
19 Partially correct 1 ms 348 KB partial
20 Correct 1 ms 348 KB ok
21 Correct 1 ms 348 KB ok
22 Partially correct 1 ms 500 KB partial
23 Partially correct 0 ms 348 KB partial
24 Partially correct 1 ms 348 KB partial
25 Partially correct 0 ms 348 KB partial
26 Partially correct 0 ms 348 KB partial
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 344 KB partial
2 Correct 1 ms 348 KB ok
3 Correct 0 ms 348 KB ok
4 Correct 0 ms 348 KB ok
5 Correct 0 ms 348 KB ok
6 Partially correct 0 ms 344 KB partial
7 Partially correct 0 ms 348 KB partial
8 Partially correct 1 ms 344 KB partial
9 Partially correct 0 ms 344 KB partial
10 Partially correct 0 ms 348 KB partial
11 Correct 0 ms 348 KB ok
12 Correct 1 ms 348 KB ok
13 Partially correct 0 ms 348 KB partial
14 Partially correct 0 ms 348 KB partial
15 Partially correct 0 ms 348 KB partial
16 Correct 0 ms 348 KB ok
17 Partially correct 0 ms 348 KB partial
18 Partially correct 0 ms 348 KB partial
19 Partially correct 0 ms 348 KB partial
20 Partially correct 1 ms 348 KB partial
21 Partially correct 1 ms 348 KB partial
22 Correct 1 ms 348 KB ok
23 Correct 1 ms 348 KB ok
24 Partially correct 1 ms 500 KB partial
25 Partially correct 0 ms 348 KB partial
26 Partially correct 1 ms 348 KB partial
27 Partially correct 0 ms 348 KB partial
28 Partially correct 0 ms 348 KB partial
29 Partially correct 0 ms 344 KB partial
30 Partially correct 0 ms 348 KB partial
31 Partially correct 0 ms 348 KB partial
32 Partially correct 0 ms 348 KB partial
33 Partially correct 1 ms 348 KB partial
34 Correct 0 ms 348 KB ok
35 Correct 1 ms 348 KB ok
36 Partially correct 0 ms 348 KB partial
37 Partially correct 0 ms 348 KB partial
38 Partially correct 0 ms 348 KB partial
39 Partially correct 1 ms 348 KB partial
40 Partially correct 1 ms 348 KB partial
41 Partially correct 1 ms 600 KB partial
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 344 KB partial
2 Correct 1 ms 348 KB ok
3 Correct 0 ms 348 KB ok
4 Correct 0 ms 348 KB ok
5 Correct 0 ms 348 KB ok
6 Partially correct 0 ms 344 KB partial
7 Partially correct 0 ms 348 KB partial
8 Partially correct 1 ms 344 KB partial
9 Partially correct 0 ms 344 KB partial
10 Partially correct 0 ms 348 KB partial
11 Correct 0 ms 348 KB ok
12 Correct 1 ms 348 KB ok
13 Partially correct 0 ms 348 KB partial
14 Partially correct 0 ms 348 KB partial
15 Partially correct 0 ms 348 KB partial
16 Correct 0 ms 348 KB ok
17 Partially correct 0 ms 348 KB partial
18 Partially correct 0 ms 348 KB partial
19 Partially correct 0 ms 348 KB partial
20 Partially correct 1 ms 348 KB partial
21 Partially correct 1 ms 348 KB partial
22 Correct 1 ms 348 KB ok
23 Correct 1 ms 348 KB ok
24 Partially correct 1 ms 500 KB partial
25 Partially correct 0 ms 348 KB partial
26 Partially correct 1 ms 348 KB partial
27 Partially correct 0 ms 348 KB partial
28 Partially correct 0 ms 348 KB partial
29 Partially correct 0 ms 344 KB partial
30 Partially correct 0 ms 348 KB partial
31 Partially correct 0 ms 348 KB partial
32 Partially correct 0 ms 348 KB partial
33 Partially correct 1 ms 348 KB partial
34 Correct 0 ms 348 KB ok
35 Correct 1 ms 348 KB ok
36 Partially correct 0 ms 348 KB partial
37 Partially correct 0 ms 348 KB partial
38 Partially correct 0 ms 348 KB partial
39 Partially correct 1 ms 348 KB partial
40 Partially correct 1 ms 348 KB partial
41 Partially correct 1 ms 600 KB partial
42 Partially correct 16 ms 3420 KB partial
43 Partially correct 16 ms 3416 KB partial
44 Partially correct 18 ms 5212 KB partial
45 Partially correct 17 ms 5724 KB partial
46 Partially correct 16 ms 3676 KB partial
47 Partially correct 19 ms 7324 KB partial
48 Execution timed out 4533 ms 6304 KB Time limit exceeded
49 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 344 KB partial
2 Correct 1 ms 348 KB ok
3 Correct 0 ms 348 KB ok
4 Correct 0 ms 348 KB ok
5 Correct 0 ms 348 KB ok
6 Correct 0 ms 392 KB ok
7 Partially correct 0 ms 348 KB partial
8 Partially correct 3 ms 860 KB partial
9 Partially correct 145 ms 7328 KB partial
10 Execution timed out 4573 ms 80976 KB Time limit exceeded
11 Halted 0 ms 0 KB -