QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#524781 | #6341. The Last Battle | wxhtzdy | 0 | 45ms | 3976kb | C++17 | 2.7kb | 2024-08-20 05:59:53 | 2024-08-20 05:59:54 |
Judging History
Anna
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int variable_example = 0;
}
void Anna(int X, int Y, int N, string S) {
vector<vector<bool>> used(8, vector<bool>(8));
for (int i = 0; i < 5; i++) {
if (i != X && i != Y) {
Paint(i, i, (X >> 2 & 1) ^ (Y >> 2 & 1));
}
used[i][i] = true;
}
vector<pair<int, int>> cells;
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
if (used[i][j]) {
continue;
}
if (i == X || j == Y) {
continue;
}
if (((i >> 2 & 1) ^ (j >> 2 & 1)) != ((X >> 2 & 1) ^ (Y >> 2 & 1))) {
cells.emplace_back(i, j);
}
}
}
auto Do = [&](pair<int, int> p, int b) {
int x = p.first;
int y = p.second;
used[x][y] = true;
Paint(x, y, b);
};
Do(cells[0], X >> 0 & 1);
Do(cells[1], X >> 1 & 1);
Do(cells[2], X >> 2 & 1);
Do(cells[3], Y >> 0 & 1);
Do(cells[4], Y >> 1 & 1);
Do(cells[5], Y >> 2 & 1);
int ptr = 0;
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
if (i == X || j == Y || used[i][j]) {
continue;
}
if (ptr < N) {
Paint(i, j, S[ptr] == 'A' ? 0 : 1);
ptr += 1;
} else {
Paint(i, j, 0);
}
}
}
}
Bruno
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int variable_example = 0;
}
string Bruno(int N, vector<vector<int>> T) {
int xr = 0;
{
vector<int> c(2);
for (int i = 0; i < 5; i++) {
c[T[i][i]] += 1;
}
if (c[1] > c[0]) {
xr += (1 << 2);
}
}
vector<vector<bool>> used(8, vector<bool>(8));
for (int i = 0; i < 5; i++) {
used[i][i] = true;
}
vector<pair<int, int>> cells;
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
if (used[i][j]) {
continue;
}
if (((i >> 2 & 1) ^ (j >> 2 & 1)) != xr) {
cells.emplace_back(i, j);
}
}
}
int X = 0, Y = 0;
X += (T[cells[0].first][cells[0].second]) * 1;
X += (T[cells[1].first][cells[1].second]) * 2;
X += (T[cells[2].first][cells[2].second]) * 4;
Y += (T[cells[3].first][cells[3].second]) * 1;
Y += (T[cells[4].first][cells[4].second]) * 2;
Y += (T[cells[5].first][cells[5].second]) * 4;
for (int i = 0; i < 6; i++) {
used[cells[i].first][cells[i].second] = true;
}
string res = "";
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
if (used[i][j]) {
continue;
}
if (i == X || j == Y) {
continue;
}
if ((int) res.size() < N) {
res += (T[i][j] == 0 ? 'A' : 'B');
}
}
}
return res;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 45ms
memory: 3976kb
Manager to Anna
20000 1 7 1 A 2 3 1 A 0 1 1 A 1 1 1 A 7 4 1 A 2 3 1 A 0 3 1 B 0 7 1 A 4 2 1 B 5 4 1 A 6 0 1 B 7 3 1 A 0 7 1 A 2 3 1 A 1 6 1 A 5 2 1 B 2 7 1 B 6 3 1 A 3 3 1 A 1 7 1 A 2 3 1 A 1 2 1 A 5 3 1 A 3 5 1 A 4 3 1 A 2 3 1 A 4 6 1 B 7 3 1 B 2 3 1 A 4 4 1 A 7 3 1 A 4 5 1 B 0 7 1 A 0 3 1 B 2 0 1 B 4 1 1 A 6 0 1 ...
Anna to Manager
1100000111100000010000000100000000000000000000000 0000101000100000000000000000000000000000000000000 0000001000000000000000000000000000000000000000000 0001001000000000000000000000000000000000000000000 0000111000000100000000000000000000000000000000000 0000101000100000000000000000000000000000000000000 ...
Manager to Bruno
20000 1 1100000110010100111100000001000000001001000000000000000100000000 1 0001010100001000000011000001000000010000000100000000000000010000 1 1101011101000001000000000100000000000000010000000100000001000000 1 0100100100000001000000000000000000000000010000000000000000000000 1 000011110000100100000000...
Bruno to Manager
B A A A A A A B A A A A A A A A B A A B A A A A B A A A A A A B A B B A A A B A A A A A A A A A A B B A B B A A A A A A A A A A A A A A B B A B A A B A A A B A B B A A A A A A A A A A B A A B A A A A A A A A A A A A A A B B A A B A A A B B A A A A A A B B A B A A A A A A A A A A B A A A A A A A A B ...
result:
points 0.0 Accepted: 0