Submission #1246803

#TimeUsernameProblemLanguageResultExecution timeMemory
1246803eradaxVision Program (IOI19_vision)C++20
Compilation error
0 ms0 KiB
    for (int j = 0; j < W; j++) {
            vpi checks;
            for (int k = i; k < H; k++) {
                for (int w = 0; w < W; w++) {
                    if (abs(i - k) + abs(j - w) == K)
                        checks.emplace_back(k, w);
                }
            }

            if (checks.empty())
                continue;

            vi check_trans;
            for (auto [x, y] : checks)
                check_trans.push_back(x * W + y);

            add_or(check_trans);
            inst++;
            add_and({i * W +  j, inst - 1});
            inst++;
            imp.push_back(inst - 1);
        }
    }

    add_or(imp);
    inst++;
}

Compilation message (stderr)

vision.cpp:1:5: error: expected unqualified-id before 'for'
    1 |     for (int j = 0; j < W; j++) {
      |     ^~~
vision.cpp:1:25: error: 'W' was not declared in this scope
    1 |     for (int j = 0; j < W; j++) {
      |                         ^
vision.cpp:1:25: error: 'W' was not declared in this scope
vision.cpp:1:25: error: 'W' was not declared in this scope
vision.cpp:1:25: error: 'W' was not declared in this scope
vision.cpp:1:25: error: 'W' was not declared in this scope
vision.cpp:1:25: error: 'W' was not declared in this scope
vision.cpp:1:25: error: 'W' was not declared in this scope
vision.cpp:1:25: error: 'W' was not declared in this scope
vision.cpp:1:25: error: 'W' was not declared in this scope
vision.cpp:1:21: error: 'j' does not name a type
    1 |     for (int j = 0; j < W; j++) {
      |                     ^
vision.cpp:1:28: error: 'j' does not name a type
    1 |     for (int j = 0; j < W; j++) {
      |                            ^
vision.cpp:23:5: error: expected declaration before '}' token
   23 |     }
      |     ^
vision.cpp:25:11: error: expected constructor, destructor, or type conversion before '(' token
   25 |     add_or(imp);
      |           ^
vision.cpp:26:5: error: 'inst' does not name a type; did you mean 'int'?
   26 |     inst++;
      |     ^~~~
      |     int
vision.cpp:27:1: error: expected declaration before '}' token
   27 | }
      | ^