QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#150679 | #6341. The Last Battle | JCY_ | 0 | 0ms | 0kb | C++17 | 2.0kb | 2023-08-26 00:21:13 | 2023-08-26 00:21:16 |
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>> mat) {
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 && mat[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' + mat[i][j];
}
}
return ret;
}
詳細信息
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 ...