QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#557118 | #9237. Message | Insert_Username_Here | 0 | 201ms | 4052kb | C++20 | 1.7kb | 2024-09-11 03:37:47 | 2024-09-11 03:37:47 |
Judging History
answer
#include "message.h"
#include <bits/stdc++.h>
using namespace std;
void send_message(vector<bool> M, vector<bool> C) {
int arr[16], cnt = 0;
for(int i = 0; i < 31; i++) {
if(!C[i]) arr[cnt++] = i;
}
vector<bool> msg[66];
for(int i = 0; i < 66; i++) msg[i] = vector<bool>(31, 0);
for(int i = 0; i < 15; i++) msg[arr[i + 1] - arr[i] - 1][arr[i]] = 1;
msg[arr[0] + 30 - arr[15]][arr[15]] = 1;
cnt = 0;
for(int i = 0; i < 16; i++) {
int bk = 0;
for(int j = 0; j < 66; j++) {
if(bk) {
if(cnt < (int)M.size()) msg[j][arr[i]] = M[cnt++];
else msg[j][arr[i]] = (cnt++ == (int)M.size());
}
if(msg[j][arr[i]]) bk = 1;
}
}
for(int i = 0; i < 66; i++) send_packet(msg[i]);
}
vector<bool> receive_message(vector<vector<bool>> R) {
int nxt[31], arr[16];
for(int i = 0; i < 31; i++) {
nxt[i] = -1;
for(int j = 0; j < 16; j++) {
if(R[j][i]) {
nxt[i] = (i + j + 1) % 31;
break;
}
}
}
int cur;
for(int i = 0; i < 31; i++) {
cur = i;
for(int j = 0; j < 16; j++) {
if(cur < 0) break;
cur = nxt[cur];
}
if(cur == i) break;
}
arr[0] = cur;
for(int j = 1; j < 16; j++) arr[j] = nxt[arr[j - 1]];
vector<bool> ans;
for(int i = 0; i < 16; i++) {
cur = 0;
for(int j = 0; j < 66; j++) {
if(cur) ans.push_back(R[j][arr[i]]);
if(!cur && R[j][arr[i]]) arr[i + 1] = arr[i] + j - 3, cur = 1;
}
}
while(!ans.back()) ans.pop_back();
ans.pop_back();
return ans;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 201ms
memory: 4052kb
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: 140ms
memory: 3852kb
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