QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#819096 | #9237. Message | Flamire# | 0 | 201ms | 3996kb | C++17 | 1.6kb | 2024-12-18 12:34:53 | 2024-12-18 12:34:53 |
Judging History
answer
#include <bits/stdc++.h>
#include "message.h"
using namespace std;
int a[100011];long long seed=chrono::steady_clock::now().time_since_epoch().count();
void send_message(vector<bool> M,vector<bool> C)
{
// printf("send_message():\n");
// printf("M:");for(bool x:M)printf("%d",x);putchar(10);
// printf("C:");for(bool x:C)printf("%d",x);putchar(10);
mt19937 rnd(seed);
int Sok=0,SC=0;
for(int i=0;i<31;++i)SC|=C[i]<<i;
while(Sok^SC)
{
// printf("Sok:%d SC:%d\n",Sok,SC);
unsigned x=rnd();
vector<bool> msg(C.size(),0);
for(int j=0;j<C.size();++j)if(!C[j])msg[j]=x>>j&1;
vector<bool> tt=send_packet(msg);
for(int j=0;j<C.size();++j)if(tt[j]!=(x>>j&1))Sok|=1<<j;
}
M.push_back(1);
while(M.size()<1025)M.push_back(0);
int S=M.size(),pt=0;
// printf("need %d\n",(S+15)/16);
for(int i=0;i<(S+15)/16;++i)
{
vector<bool> msg(C.size(),0);
for(int j=0;j<C.size();++j)if(!C[j])
{//printf("(%d,%d) pt:%d\n",i,j,pt+1);
if(pt<S)msg[j]=M[pt++];
}
send_packet(msg);
}
}
vector<bool> receive_message(vector<vector<bool>> R)
{
mt19937 rnd(seed);
int K=R.size()-65;
int SC=0;
for(int i=0;i<K;++i)
{
unsigned x=rnd();
for(int _=0;_<31;++_)if(R[i][_]!=(x>>_&1))SC|=1<<_;
}
// printf("C:");for(int i=0;i<31;++i)printf("%d ",SC>>i&1);putchar(10);
// printf("K:%d\n",K);
vector<bool> M;
for(int i=K;i<R.size();++i)
{
for(int _=0;_<R[i].size();++_)if(!(SC>>_&1))M.push_back(R[i][_]);
}
// for(bool x:M)printf("%d ",x);putchar(10);
while(!M.back())M.pop_back();
M.pop_back();
// for(bool x:M)printf("%d ",x);putchar(10);
return M;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 164ms
memory: 3996kb
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: 201ms
memory: 3764kb
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