QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#484778#1819. Cleaning RobotXC230595Compile Error//C++14249b2024-07-19 22:57:472024-07-19 22:57:47

Judging History

你现在查看的是最新测评结果

  • [2024-07-19 22:57:47]
  • 评测
  • [2024-07-19 22:57:47]
  • 提交

answer

// rows
    for (int i = 1; i <= n; i++) {
        int prev = 0;
        for (int j = 1; j <= n+1; j++) {
            if (!carpet[i][j]) continue;
            if (j-prev-1 != 0) ans = min(j-prev-1, ans);
            prev = j;
        }
    }

详细

answer.code:2:5: error: expected unqualified-id before ‘for’
    2 |     for (int i = 1; i <= n; i++) {
      |     ^~~
answer.code:2:21: error: ‘i’ does not name a type
    2 |     for (int i = 1; i <= n; i++) {
      |                     ^
answer.code:2:29: error: ‘i’ does not name a type
    2 |     for (int i = 1; i <= n; i++) {
      |                             ^