QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#150683 | #6341. The Last Battle | JCY_ | 0 | 0ms | 0kb | C++17 | 2.0kb | 2023-08-26 00:29:26 | 2023-08-26 00:29:27 |
Anna
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
constexpr int msk[72] = {6, 168, 18, 50, 76, 214, 152, 72, 60, 181, 24, 177, 37, 133, 176, 101, 82, 193, 147, 226, 98, 91, 43, 11, 224, 196, 67, 80, 134, 132, 17, 100, 174, 205, 235, 33, 203, 0, 173, 38, 128, 220, 90, 148, 4, 12, 14, 2, 144, 184, 1, 146, 40, 10, 45, 21, 8, 64, 27, 113, 13, 84, 35, 3, 124, 68, 115, 97, 96, 211, 138, 117};
} // namespace
void Anna(int X, int Y, int n, string S) {
int id;
if (X == Y && S[0] == 'B') {
id = 64 + X;
} else {
id = X * 8 + Y;
}
for (int i = 0; i < 8; ++i)
if (i != X && i != Y) Paint(i, i, msk[id] >> i & 1);
int ptr = (X == Y);
for (int i = 0; i < 8; ++i) {
for (int j = 0; j < 8; ++j) {
if (i == X || j == Y || i == j) continue;
Paint(i, j, ptr == n ? 0 : S[ptr++] == 'B');
}
}
}
Bruno
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
constexpr int msk[72] = {6, 168, 18, 50, 76, 214, 152, 72, 60, 181, 24, 177, 37, 133, 176, 101, 82, 193, 147, 226, 98, 91, 43, 11, 224, 196, 67, 80, 134, 132, 17, 100, 174, 205, 235, 33, 203, 0, 173, 38, 128, 220, 90, 148, 4, 12, 14, 2, 144, 184, 1, 146, 40, 10, 45, 21, 8, 64, 27, 113, 13, 84, 35, 3, 124, 68, 115, 97, 96, 211, 138, 117};
} // namespace
string Bruno(int N, vector<vector<int>> T) {
int id = -1;
for (int i = 0; i < 72; ++i) {
int ban0 = i >> 3, ban1 = i & 7;
if (i >= 64) ban0 = ban1 = i - 64;
bool match = true;
for (int j = 0; j < 8; ++j) {
if (j != ban0 && j != ban1 && T[j][j] != (msk[i] >> j & 1)) {
match = false;
break;
}
}
if (match) {
id = i;
break;
}
}
string ret(N, 'A');
int ban0 = id >> 3, ban1 = id & 7;
if (id >= 64) {
ret[0] = 'B';
ban0 = ban1 = id - 64;
}
int ptr = (ban0 == ban1);
for (int i = 0; i < 8 && ptr < N; ++i) {
for (int j = 0; j < 8 && ptr < N; ++j) {
if (i == ban0 || j == ban1 || i == j) continue;
ret[ptr++] = 'A' + T[i][j];
}
}
return ret;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Checker Judgement Failed
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
1000000001000000000000000000000001000000010000000 0000000010000000000000000000000010000000100000001 0000000000000000100000000000000010000000000000001 1000000010000000000000001000000010000000000000001 1000000000000000100000001000000000000000000000000 0000000010000000000000000000000010000000100000001 ...