QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#743607 | #9237. Message | TheZone | 100 ✓ | 214ms | 4116kb | C++20 | 1.4kb | 2024-11-13 19:37:50 | 2024-11-13 19:37:52 |
Judging History
answer
#include "message.h"
using std::vector;
void send_message(vector<bool> M, vector<bool> C) {
vector<int> d(31, 0);
for (int i = 0; i < 31; ++i) {
if (!C[i]) {
int k = 1;
for (; C[(i + k) % 31]; ++k) {
}
d[i] = k;
}
}
M.push_back(1);
for (; M.size() < 1025; M.push_back(0)) {
}
int c = 0;
for (int i = 0; i < 66; ++i) {
vector<bool> r(31, 0);
for (int j = 0; j < 31; ++j) {
if (!C[j]) {
if (d[j]) {
r[j] = !--d[j];
} else {
r[j] = M[c++];
}
}
}
send_packet(r);
}
}
vector<bool> receive_message(vector<vector<bool>> R) {
vector<int> d(31, 0);
for (int i = 0; i < 66; ++i) {
for (int j = 0; j < 31; ++j) {
if (!d[j] && R[i][j]) {
d[j] = i + 1;
}
}
}
for (int i = 0; i < 31; ++i) {
if (d[i] >= 31) {
d[i] = 0;
}
}
vector<int> l;
for (int s = 0; s < 31; ++s) {
l.clear();
int x = s;
for (int i = 0; i < 16 && (!i || x != s); ++i, x = (x + d[x]) % 31) {
l.push_back(x);
}
if (l.size() == 16 && x == s) {
break;
}
}
vector<bool> M;
for (int i = 0; i < 66; ++i) {
for (int j : l) {
if (i >= d[j]) {
M.push_back(R[i][j]);
}
}
}
for (; !M.back(); M.pop_back()) {
}
M.pop_back();
return M;
}
/**/
詳細信息
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 167ms
memory: 4024kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #2:
score: 10
Accepted
time: 161ms
memory: 3748kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #3:
score: 10
Accepted
time: 192ms
memory: 4104kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #4:
score: 10
Accepted
time: 192ms
memory: 3836kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #5:
score: 10
Accepted
time: 85ms
memory: 3768kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #6:
score: 10
Accepted
time: 70ms
memory: 4028kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #7:
score: 10
Accepted
time: 114ms
memory: 3808kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Subtask #2:
score: 90
Accepted
Test #8:
score: 90
Accepted
time: 192ms
memory: 3844kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #9:
score: 90
Accepted
time: 169ms
memory: 4012kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #10:
score: 90
Accepted
time: 214ms
memory: 3808kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #11:
score: 90
Accepted
time: 126ms
memory: 4104kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #12:
score: 90
Accepted
time: 170ms
memory: 3800kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #13:
score: 90
Accepted
time: 113ms
memory: 4108kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #14:
score: 90
Accepted
time: 88ms
memory: 4040kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #15:
score: 90
Accepted
time: 132ms
memory: 4032kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #16:
score: 90
Accepted
time: 138ms
memory: 3696kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #17:
score: 90
Accepted
time: 152ms
memory: 4028kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #18:
score: 90
Accepted
time: 199ms
memory: 4036kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #19:
score: 90
Accepted
time: 186ms
memory: 3744kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #20:
score: 90
Accepted
time: 169ms
memory: 3804kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #21:
score: 90
Accepted
time: 155ms
memory: 3788kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #22:
score: 90
Accepted
time: 183ms
memory: 4116kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #23:
score: 90
Accepted
time: 214ms
memory: 3752kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #24:
score: 90
Accepted
time: 214ms
memory: 3788kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #25:
score: 90
Accepted
time: 172ms
memory: 4040kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #26:
score: 90
Accepted
time: 166ms
memory: 3992kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #27:
score: 90
Accepted
time: 130ms
memory: 3840kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Extra Test:
score: 0
Extra Test Passed