QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#846004 | #9237. Message | sunlight | 0 | 0ms | 0kb | C++23 | 1.4kb | 2025-01-06 21:01:41 | 2025-01-06 21:01:42 |
answer
#include<bits/stdc++.h>
using namespace std;
void send_message(std::vector<bool> M, std::vector<bool> C)
{
mt19937 rnd(353442899);
vector<bool>vec[66];
for(int i=1;i<=64;i++)
{
vec[i].resize(31);
}
__int128 cnt=0;
for(int j=0;j<31;j++)
{
if(C[j]==1)
cnt+=rnd()/j;
for(int i=1;i<=64;i++)
{
if(C[j]==1)
vec[i][j]=0;
else
{
long long us=rnd();
vec[i][j]=(cnt*37/us+us)%2;
}
}
}
for(int i=1;i<=64;i++)
{
std::vector<bool> send_packet(vec[i]);
}
cnt=0;
for(int i=1;i<=2;i++)
{
for(int j=0;j<31;j++)
{
if(C[j]==1)
vec[i][j]=0;
else
{
if(cnt<=30)
vec[i][j]=M[cnt];
cnt++;
}
}
std::vector<bool> send_packet(vec[i]);
}
return;
}
std::vector<bool> receive_message(std::vector<std::vector<bool>> R)
{
mt19937 rnd(353442899);
vector<long long>vec;
for(int i=0;i<=10000;i++)
{
vec.push_back(rnd());
}
bool vis[31];
memset(vis,0,sizeof(vis));
__int128 cnt=0;
int nw=0;
for(int i=0;i<31;i++)
{
bool f=0;
for(int j=0;j<64;j++)
{
if((cnt*37/vec[nw+j]+vec[nw+j])%2!=R[j][i])
{
f=1;
break;
}
}
if(f==1)
{
cnt+=vec[nw++]/i;
}
else
{
vis[i]=1;
}
nw+=64;
}
vector<bool>ans(31);
cnt=0;
for(int i=64;i<=65;i++)
{
for(int j=0;j<31;j++)
{
if(vis[j]==0)
continue;
if(cnt<=30)
{
ans[j]=R[i][j];
}
cnt++;
}
}
return ans;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Instance #0 Runtime Error
Test #1:
score: 0
Instance #0 Runtime Error
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
0 ing with message 'manual RTE, cant read int from grader' Sending secret with code DIE to mgr2sol[1] Quitting with result code 1
result:
Subtask #2:
score: 0
Instance #0 Runtime Error
Test #8:
score: 0
Instance #0 Runtime Error
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
0 ing with message 'manual RTE, cant read int from grader' Sending secret with code DIE to mgr2sol[1] Quitting with result code 1