Submission #922524

# Submission time Handle Problem Language Result Execution time Memory
922524 2024-02-05T15:56:44 Z salmon Painting Walls (APIO20_paint) C++14
Compilation error
0 ms 0 KB
int it = 0;
        int it1 = 0;

        vector<int> temp;
        if(contract[i].size() != 0 && contract[i][0] == 0) temp.push_back(0);

        while(it < v.size() && it1 < contract[i].size()){
            if(v[it] + 1 == contract[i][it1]){
                if(v[it] != M - 1) temp.push_back(v[it] + 1);
                else{
                    can[i] = true;
                }
            }

            if(v[it] + 1 <= contract[i][it1]){
                it++;
            }
            else{
                it1++;
            }
        }

Compilation message

paint.cpp:4:9: error: 'vector' does not name a type
    4 |         vector<int> temp;
      |         ^~~~~~
paint.cpp:5:9: error: expected unqualified-id before 'if'
    5 |         if(contract[i].size() != 0 && contract[i][0] == 0) temp.push_back(0);
      |         ^~
paint.cpp:7:9: error: expected unqualified-id before 'while'
    7 |         while(it < v.size() && it1 < contract[i].size()){
      |         ^~~~~