QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#555788 | #9237. Message | zhouhuanyi# | 0 | 219ms | 4084kb | C++17 | 1.6kb | 2024-09-10 09:54:33 | 2024-09-10 09:54:33 |
Judging History
answer
#include "message.h"
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
const __int128 mod=((__int128)(1)<<69)-19;
bool rd[11][31],used[31],delta[1025];
unsigned long long seed;
bool get_rand()
{
seed^=(seed<<7);
seed^=(seed<<13);
seed^=(seed>>19);
return seed&1;
}
void send_message(std::vector<bool> M, std::vector<bool> C)
{
int ps=-1;
vector<bool>p;
seed=998244353;
for (int i=0;i<=1024;++i) delta[i]=0;
for (int i=0;i<M.size();++i) delta[i]=M[i];
delta[M.size()]=1;
for (int i=1;i<=10;++i)
for (int j=0;j<=30;++j)
rd[i][j]=get_rand();
for (int i=1;i<=10;++i)
{
p.clear();
for (int j=0;j<=30;++j)
{
if (C[j]) p.push_back(get_rand());
else p.push_back(rd[i][j]);
}
send_packet(p);
}
for (int i=1;i<=66;++i)
{
p.clear();
for (int j=0;j<=30;++j)
{
if (C[j]) p.push_back(get_rand());
else if (ps+1<=1024) p.push_back(delta[++ps]);
else p.push_back(get_rand());
}
send_packet(p);
}
return;
}
std::vector<bool> receive_message(std::vector<std::vector<bool>> R)
{
int ps=-1;
vector<bool>p;
seed=998244353;
for (int i=0;i<=1024;++i) delta[i]=0;
for (int i=1;i<=10;++i)
for (int j=0;j<=30;++j)
rd[i][j]=get_rand();
for (int i=0;i<=30;++i) used[i]=1;
for (int i=1;i<=10;++i)
for (int j=0;j<=30;++j)
used[j]&=(R[i-1][j]==rd[i][j]);
for (int i=1;i<=66;++i)
for (int j=0;j<=30;++j)
if (used[j]&&ps+1<=1024)
delta[++ps]=R[i+9][j];
for (int i=ps;i>=0;--i)
if (delta[i])
{
for (int j=0;j<=i-1;++j) p.push_back(delta[j]);
break;
}
return p;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 124ms
memory: 3760kb
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: 219ms
memory: 4084kb
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