제출 #1352494

#제출 시각아이디문제언어결과실행 시간메모리
1352494lukaye_19Casino (JOI26_casino)C++20
컴파일 에러
0 ms0 KiB
vector<vector<int>>Azzuro(int N, int L, string S)
{
    vector<vector<int>>encoded(8,vector<int>(8));
    int total = 0;
    
    for (int i = 0; i < 8; i++)
        for (int j = 0; j < 8; j++)
        {
            if (i % 2 == 1 && j % 2 == 1) 
            {
                total++;
                
                encoded[i][j] = S[total] == 'A' ? 0 : 1
            }
            else encoded[i][j] = 0;
        }
    
    return encoded;
}
string Bordeaux(int N, int L, vector<vector<int>>T)
{
    int total = 0;
    
    string R = "";
    
    for (int i = 0; i < 8; i++)
    {
        for (int j = 0; j < 8; j++)
        {
            if (i % 2 == 1 && j % 2 == 1)
            {
                total++;
                
                bool reversed = false;
                
                if (i < 7 && j < 7)
                {
                    int toprightn = t[i + 1][j - 1];
                    int bottomleftn = t[i - 1][j + 1];
                    
                    int topn = t[i][j - 1];
                    int bottomn = t[i][j + 1];
                    
                    int leftn = t[i - 1][j];
                    int rightn = t[i + 1][j];
                    
                    int totalentries = topn + bottomn + leftn + rightn;
                    
                    else if (totalentries == 2 && (toprightn + bottomleftn == 0)) reversed = true;
                }
                
                int currentR = t[i][j];
                
                if (reversed) currentR = 1 - currentR;
                
                if (currentR) R.push_back('B');
                else R.push_back('A');
            }
            
            if (total == L) break;
        }
        
        if (total == L) break;
    }
    
    return R;
}

컴파일 시 표준 에러 (stderr) 메시지

# 1번째 컴파일 단계

Azzurro.cpp:1:8: error: 'vector' was not declared in this scope
    1 | vector<vector<int>>Azzuro(int N, int L, string S)
      |        ^~~~~~
Azzurro.cpp:1:8: error: 'vector' was not declared in this scope
Azzurro.cpp:1:8: error: 'vector' was not declared in this scope
Azzurro.cpp:1:8: error: 'vector' was not declared in this scope
Azzurro.cpp:1:8: error: 'vector' was not declared in this scope
Azzurro.cpp:1:8: error: 'vector' was not declared in this scope
Azzurro.cpp:1:8: error: 'vector' was not declared in this scope
Azzurro.cpp:1:8: error: 'vector' was not declared in this scope
Azzurro.cpp:1:8: error: 'vector' was not declared in this scope
Azzurro.cpp:1:1: error: 'vector' does not name a type
    1 | vector<vector<int>>Azzuro(int N, int L, string S)
      | ^~~~~~