QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#592270 | #9237. Message | December456 | 0 | 205ms | 4112kb | C++17 | 1.3kb | 2024-09-26 21:41:03 | 2024-09-26 21:41:03 |
Judging History
answer
#include "message.h"
void send_message(std::vector<bool> M, std::vector<bool> C) {
std::vector<int> A;
for (int i = 0; i < 30; i ++) {
send_packet(std::vector<bool>(31, C[i]));
if (!C[i]) {
A.push_back(i);
}
}
std::vector<bool> P(31);
for (int i = 0; i < 4; i ++) {
P[A[i]] = M.size() >> i & 1;
}
send_packet(P);
for (int i = 0; i < M.size(); i += 16) {
for (int j = i; j < i + 16 && j < M.size(); j ++) {
P[A[j - i]] = M[j];
}
send_packet(P);
}
}
std::vector<bool> receive_message(std::vector<std::vector<bool>> R) {
std::vector<bool> M;
std::vector<int> A;
for (int i = 0; i < 30; i ++) {
int cnt = 0;
for (int x : R[i]) {
cnt += x;
}
if (cnt << 1 < 31) {
A.push_back(i);
}
}
if (A.size() < 16) {
A.push_back(30);
}
int res = 0;
for (int i = 0; i < 4; i ++) {
res |= R[30][A[i]] << i;
}
if (!res) {
res = 16;
}
for (int i = 31; i + 1 < R.size(); i ++) {
for (int j = 0; j < 16; j ++) {
M.push_back(R[i][A[j]]);
}
}
for (int i = 0; i < res; i ++) {
M.push_back(R.back()[A[i]]);
}
return M;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 88ms
memory: 4044kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
0 ing with message 'decoded message is incorrect' Sending secret with code DIE to mgr2sol[1] Quitting with result code 1
result:
wrong output format Extra information in the output file
Subtask #2:
score: 0
Wrong Answer
Test #8:
score: 0
Wrong Answer
time: 205ms
memory: 4112kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
0 ing with message 'decoded message is incorrect' Sending secret with code DIE to mgr2sol[1] Quitting with result code 1
result:
wrong output format Extra information in the output file