| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1352501 | lukaye_19 | Casino (JOI26_casino) | C++20 | 0 ms | 0 KiB |
#include "Azzurro.h"
#include <bits/stdc++.h>
using namespace std;
vector<vector<int>>Azzurro(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 <Bordeaux.h>
#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;
}