Submission #1352495

#TimeUsernameProblemLanguageResultExecution timeMemory
1352495lukaye_19Casino (JOI26_casino)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

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;
}
#include <bits/stdc++.h>
using namespace std;

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;
}

Compilation message (stderr)

# 1번째 컴파일 단계

Azzurro.cpp: In function 'std::vector<std::vector<int> > Azzuro(int, int, std::string)':
Azzurro.cpp:16:56: error: expected ';' before '}' token
   16 |                 encoded[i][j] = S[total] == 'A' ? 0 : 1
      |                                                        ^
      |                                                        ;
   17 |             }
      |             ~