QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#562682 | #9237. Message | 0000pnc | 0 | 1ms | 3828kb | C++20 | 1.5kb | 2024-09-13 20:01:24 | 2024-09-13 20:01:25 |
Judging History
answer
#include <bits/stdc++.h>
#include "message.h"
using namespace std;
void send_message(vector<bool> M, vector<bool> C) {
vector<int> pos, d(31, 0);
vector<vector<bool> > all(66, vector<bool>(16, 0));
for (int i = 0; i < 31; i++) {
if (!C[i]) pos.push_back(i);
}
for (int i = 0; i < 15; i++) d[pos[i]] = pos[i + 1] - pos[i];
d[pos[15]] = pos[0] + 31 - pos[15];
vector<bool> msg;
for (bool x : M) msg.push_back(x);
msg.push_back(true);
while (msg.size() != 1025) msg.push_back(false);
for (int i = 0, cur = 0; i < 66; i++) {
for (int j = 0; j < 31; j++) {
if (!C[j]) {
if (i < d[j]) {
if (i == d[j] - 1) all[i][j] = 1;
else all[i][j] = 0;
}
else all[i][j] = msg[++cur];
}
}
}
for (int i = 0; i < 66; i++) {
vector<bool> useless = send_packet(all[i]);
}
}
vector<bool> receive_message(vector<vector<bool> > R) {
vector<int> d(31, 0), to(31, 0);
for (int i = 0; i < 31; i++) {
for (int j = 0; j < 66; j++) {
if (R[i][j]) { d[i] = j + 1; break; }
}
d[i] = min(d[i], 31);
to[i] = (i + d[i]) % 31;
}
vector<bool> vis(31, false);
for (int i = 0; i < 31; i++) {
int cnt = 1, res = to[i];
while (res != i) res = to[res], cnt++;
if (cnt == 16) {
res = to[i]; vis[i] = true;
while (!vis[res]) vis[res] = 1, res = to[res];
}
}
vector<bool> msg;
for (int i = 0; i < 66; i++) {
for (int j = 0; j < 31; j++) {
if (vis[j] && i >= d[j]) {
msg.push_back(R[i][j]);
}
}
}
while (msg.back() != true) msg.pop_back();
msg.pop_back(); return msg;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3796kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
0 ing with message 'Packet size is incorrect' Sending secret with code DIE to mgr2sol[0] 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: 1ms
memory: 3828kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
0 ing with message 'Packet size is incorrect' Sending secret with code DIE to mgr2sol[0] Sending secret with code DIE to mgr2sol[1] Quitting with result code 1
result:
wrong output format Extra information in the output file