QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#885634 | #9237. Message | ASnown | 0 | 280ms | 3840kb | C++20 | 1.3kb | 2025-02-06 16:46:03 | 2025-02-06 16:46:09 |
Judging History
answer
#include<bits/stdc++.h>
#include "message.h"
using namespace std;
const int pL=32;
void send_message(vector<bool> M, vector<bool> C) {
mt19937 rnd(7823482675);
vector<bool> c(31,0);
for(int l=0;l<pL;l++) {
for(int i=0;i<=30;i++) c[i]=c[i]^(rnd()&1);
send_packet(c);
}
vector<int> pos;
for(int i=0;i<=30;i++) if(!C[i]) pos.emplace_back(i);
M.emplace_back(1);
int S=M.size();
vector<bool> A(31);
for(int i=0;i<S;i+=16) {
for(int j=0;j<16;j++) A[pos[j]]=(i+j<S?M[i+j]:0);
send_packet(A);
}
}
vector<bool> receive_message(vector<vector<bool>> R) {
int get_packet_pos=0;
auto get_packet = [&]() {
// assert(get_packet_pos!=R.size());
return R[get_packet_pos++];
};
mt19937 rnd(7823482675);
vector<bool> C(31,false);
vector<bool> c(31,0);
for(int l=0;l<pL;l++) {
for(int i=0;i<=30;i++) c[i]=c[i]^(rnd()&1);
auto A=get_packet();
for(int i=0;i<=30;i++) C[i]=C[i]|(c[i]!=A[i]);
}
vector<int> pos;
for(int i=0;i<=30;i++) if(!C[i]) pos.emplace_back(i);
// assert(pos.size()==16);
vector<bool> M;
for(;get_packet_pos!=R.size();) {
auto A=get_packet();
for(int j=0;j<16;j++) M.emplace_back(A[pos[j]]);
}
while(!M.back()) M.pop_back(); M.pop_back();
return M;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 98ms
memory: 3712kb
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: 280ms
memory: 3840kb
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