QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#292514#7120. SoccerhypeskynickCompile Error//C++14697b2023-12-28 06:42:342023-12-28 06:42:35

Judging History

你现在查看的是测评时间为 2023-12-28 06:42:35 的历史记录

  • [2024-04-28 08:08:41]
  • 管理员手动重测本题所有提交记录
  • [2023-12-28 06:42:35]
  • 评测
  • [2023-12-28 06:42:34]
  • 提交

answer

 #include <iostream>
int biggest_stadium(int N, std::vector<std::vector<int>> C)
{
    int X = -1, Y = -1;
    bool run = true;
    for (int i = 0; i < N && run; ++i)
    {
        for (int j = 0; j < N && run; ++j)
        {
            if (1 == C[i][j])
            {
                X = i;
                Y = j;
                run = false;
            }
        }
    }

    if (X == -1)
    {
        return N * N;
    }

    int ans = 0;
    auto check = [&](int x, int y)
    {
        ans = std::max(ans, (x + y) * N - x * y);
    };

    check(X, Y);
    check(N - 1 - X, Y);
    check(N - 1 - X, N - 1 - Y);
    check(X, N - 1 - Y);

    return ans;
}

詳細信息

answer.code:2:33: error: ‘std::vector’ has not been declared
    2 | int biggest_stadium(int N, std::vector<std::vector<int>> C)
      |                                 ^~~~~~
answer.code:2:39: error: expected ‘,’ or ‘...’ before ‘<’ token
    2 | int biggest_stadium(int N, std::vector<std::vector<int>> C)
      |                                       ^
answer.code: In function ‘int biggest_stadium(int, int)’:
answer.code:10:22: error: ‘C’ was not declared in this scope
   10 |             if (1 == C[i][j])
      |                      ^