답안 #839795

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
839795 2023-08-30T15:51:42 Z model_code 축구 경기장 (IOI23_soccer) C++17
12 / 100
4500 ms 6472 KB
// partially_correct/sol_db_check_N4.cpp

#include "soccer.h"
#include <iostream>
#include <array>
#include <map>
#include <algorithm>
#include <cassert>
#define xx first
#define yy second

using namespace std;
typedef pair<int, int> pii;

int biggest_stadium(int N, vector<vector<int>> C)
{
    auto prow = C, pcol = C;
    for (int i = 0; i < N; ++i)
    {
        for (int j = 0; j < N; ++j)
        {
            prow[i][j] += (j ? prow[i][j - 1] : 0);
            pcol[i][j] += (i ? pcol[i - 1][j] : 0);
        }
    }
    vector<pii> pos;
    for (int i = 0; i < N; ++i)
    {
        for (int j = 0; j < N; ++j)
        {
            if (!C[i][j])
                pos.push_back({i, j});
        }
    }
    for (int i = 0; i < pos.size(); ++i)
    {
        for (int j = 0; j < i; ++j)
        {
            auto p = pos[i], q = pos[j];
            if (p.xx != q.xx && p.yy != q.yy)
            {
                if (C[p.xx][q.yy] && C[q.xx][p.yy])
                {
                    return 0;
                }
                continue;
            }
            if (p > q)
                swap(p, q);
            if (p.xx == q.xx && prow[p.xx][q.yy] - (p.yy ? prow[p.xx][p.yy - 1] : 0) > 0)
            {
                return 0;
            }
            if (p.yy == q.yy && pcol[q.xx][p.yy] - (p.xx ? pcol[p.xx - 1][p.yy] : 0) > 0)
            {
                return 0;
            }
        }
    }
    return (int)pos.size();
}

Compilation message

soccer.cpp: In function 'int biggest_stadium(int, std::vector<std::vector<int> >)':
soccer.cpp:35:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |     for (int i = 0; i < pos.size(); ++i)
      |                     ~~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB partial
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB ok
2 Correct 1 ms 212 KB ok
3 Correct 1 ms 212 KB ok
4 Correct 1 ms 212 KB ok
5 Correct 1 ms 212 KB ok
6 Partially correct 1 ms 212 KB partial
7 Partially correct 21 ms 596 KB partial
8 Execution timed out 4561 ms 6464 KB Time limit exceeded
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB ok
2 Correct 1 ms 212 KB ok
3 Partially correct 0 ms 212 KB partial
4 Partially correct 1 ms 256 KB partial
5 Partially correct 1 ms 212 KB partial
6 Partially correct 1 ms 212 KB partial
7 Partially correct 1 ms 212 KB partial
8 Correct 1 ms 212 KB ok
9 Correct 0 ms 212 KB ok
10 Partially correct 1 ms 212 KB partial
11 Partially correct 0 ms 212 KB partial
12 Partially correct 1 ms 212 KB partial
13 Correct 1 ms 212 KB ok
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB partial
2 Correct 1 ms 212 KB ok
3 Correct 1 ms 212 KB ok
4 Partially correct 0 ms 212 KB partial
5 Partially correct 1 ms 256 KB partial
6 Partially correct 1 ms 212 KB partial
7 Partially correct 1 ms 212 KB partial
8 Partially correct 1 ms 212 KB partial
9 Correct 1 ms 212 KB ok
10 Correct 0 ms 212 KB ok
11 Partially correct 1 ms 212 KB partial
12 Partially correct 0 ms 212 KB partial
13 Partially correct 1 ms 212 KB partial
14 Correct 1 ms 212 KB ok
15 Partially correct 1 ms 212 KB partial
16 Partially correct 1 ms 212 KB partial
17 Partially correct 1 ms 212 KB partial
18 Partially correct 0 ms 212 KB partial
19 Partially correct 0 ms 212 KB partial
20 Correct 0 ms 212 KB ok
21 Correct 1 ms 212 KB ok
22 Partially correct 0 ms 212 KB partial
23 Partially correct 1 ms 212 KB partial
24 Partially correct 0 ms 212 KB partial
25 Partially correct 1 ms 212 KB partial
26 Partially correct 1 ms 212 KB partial
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB partial
2 Correct 1 ms 212 KB ok
3 Correct 1 ms 212 KB ok
4 Correct 1 ms 212 KB ok
5 Correct 1 ms 212 KB ok
6 Partially correct 0 ms 212 KB partial
7 Partially correct 1 ms 256 KB partial
8 Partially correct 1 ms 212 KB partial
9 Partially correct 1 ms 212 KB partial
10 Partially correct 1 ms 212 KB partial
11 Correct 1 ms 212 KB ok
12 Correct 0 ms 212 KB ok
13 Partially correct 1 ms 212 KB partial
14 Partially correct 0 ms 212 KB partial
15 Partially correct 1 ms 212 KB partial
16 Correct 1 ms 212 KB ok
17 Partially correct 1 ms 212 KB partial
18 Partially correct 1 ms 212 KB partial
19 Partially correct 1 ms 212 KB partial
20 Partially correct 0 ms 212 KB partial
21 Partially correct 0 ms 212 KB partial
22 Correct 0 ms 212 KB ok
23 Correct 1 ms 212 KB ok
24 Partially correct 0 ms 212 KB partial
25 Partially correct 1 ms 212 KB partial
26 Partially correct 0 ms 212 KB partial
27 Partially correct 1 ms 212 KB partial
28 Partially correct 1 ms 212 KB partial
29 Partially correct 1 ms 212 KB partial
30 Partially correct 0 ms 212 KB partial
31 Partially correct 1 ms 240 KB partial
32 Partially correct 1 ms 260 KB partial
33 Partially correct 0 ms 212 KB partial
34 Correct 1 ms 212 KB ok
35 Correct 0 ms 212 KB ok
36 Partially correct 1 ms 212 KB partial
37 Partially correct 1 ms 212 KB partial
38 Partially correct 0 ms 212 KB partial
39 Partially correct 1 ms 212 KB partial
40 Partially correct 1 ms 212 KB partial
41 Partially correct 1 ms 212 KB partial
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB partial
2 Correct 1 ms 212 KB ok
3 Correct 1 ms 212 KB ok
4 Correct 1 ms 212 KB ok
5 Correct 1 ms 212 KB ok
6 Partially correct 0 ms 212 KB partial
7 Partially correct 1 ms 256 KB partial
8 Partially correct 1 ms 212 KB partial
9 Partially correct 1 ms 212 KB partial
10 Partially correct 1 ms 212 KB partial
11 Correct 1 ms 212 KB ok
12 Correct 0 ms 212 KB ok
13 Partially correct 1 ms 212 KB partial
14 Partially correct 0 ms 212 KB partial
15 Partially correct 1 ms 212 KB partial
16 Correct 1 ms 212 KB ok
17 Partially correct 1 ms 212 KB partial
18 Partially correct 1 ms 212 KB partial
19 Partially correct 1 ms 212 KB partial
20 Partially correct 0 ms 212 KB partial
21 Partially correct 0 ms 212 KB partial
22 Correct 0 ms 212 KB ok
23 Correct 1 ms 212 KB ok
24 Partially correct 0 ms 212 KB partial
25 Partially correct 1 ms 212 KB partial
26 Partially correct 0 ms 212 KB partial
27 Partially correct 1 ms 212 KB partial
28 Partially correct 1 ms 212 KB partial
29 Partially correct 1 ms 212 KB partial
30 Partially correct 0 ms 212 KB partial
31 Partially correct 1 ms 240 KB partial
32 Partially correct 1 ms 260 KB partial
33 Partially correct 0 ms 212 KB partial
34 Correct 1 ms 212 KB ok
35 Correct 0 ms 212 KB ok
36 Partially correct 1 ms 212 KB partial
37 Partially correct 1 ms 212 KB partial
38 Partially correct 0 ms 212 KB partial
39 Partially correct 1 ms 212 KB partial
40 Partially correct 1 ms 212 KB partial
41 Partially correct 1 ms 212 KB partial
42 Partially correct 20 ms 6452 KB partial
43 Partially correct 21 ms 6396 KB partial
44 Partially correct 28 ms 6400 KB partial
45 Partially correct 21 ms 6472 KB partial
46 Partially correct 25 ms 6336 KB partial
47 Partially correct 40 ms 6412 KB partial
48 Execution timed out 4555 ms 5316 KB Time limit exceeded
49 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB partial
2 Correct 1 ms 212 KB ok
3 Correct 1 ms 212 KB ok
4 Correct 1 ms 212 KB ok
5 Correct 1 ms 212 KB ok
6 Correct 1 ms 212 KB ok
7 Partially correct 1 ms 212 KB partial
8 Partially correct 21 ms 596 KB partial
9 Execution timed out 4561 ms 6464 KB Time limit exceeded
10 Halted 0 ms 0 KB -