QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#819094 | #9237. Message | Flamire# | 0 | 136ms | 3832kb | C++17 | 1.6kb | 2024-12-18 12:28:36 | 2024-12-18 12:28:36 |
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);
int pt=0;
int 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)
{
int 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;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 136ms
memory: 3832kb
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
Instance #1 Runtime Error
Test #8:
score: 0
Instance #1 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' Quitting with result code 1