QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#818996 | #9237. Message | dongyc666# | Compile Error | / | / | C++17 | 1022b | 2024-12-18 11:34:26 | 2024-12-18 11:34:28 |
Judging History
This is the latest submission verdict.
- [2024-12-18 11:34:28]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-12-18 11:34:26]
- Submitted
answer
#include<bits/stdc++.h>
#include "message.h"
using namespace std;
mt19937 rnd(114514);
#define pb emplace_back
void send_message(vector<bool> Ans,vector<bool> C){
int s1=0,s2=0;
for(int i=0;i<31;++i)s1|=C[i]<<i;
while(s1!=s2){
int x=rnd();
vector<bool>arr(31,0);
for(int j=0;j<31;j++)arr[j]=x>>j&1;
vector<bool>tmp=send_packet(arr);
for(int j=0;j<31;j++)
if(tmp[j]!=(x>>j&1))s2|=1<<j;
}
Ans.push_back(1);
while(Ans.size()<1025)Ans.pb(0);
int S=Ans.size(),now=0;
for(int i=1;i<=65;i++){
vector<bool>arr(31,0);
for(int j=0;j<C.size();++j)
if(!C[j]&&now<S)arr[j]=M[now++];
send_packet(arr);
}
}
vector<bool> receive_message(vector<vector<bool> > R){
int s=0;
for(int i=0;i<R.size()-64;i++){
int x=rnd();
for(int j=0;j<31;j++)
if(R[i][j]!=((x>>j)&1))s|=1<<j;
}
vector<bool>Ans;
for(int i=R.size()-64;i<R.size();i++)
for(int j=0;j<31;j++)
if(!((s>>j)&1))Ans.pb(R[i][j]);
while(!Ans.back())Ans.pop_back();
Ans.pop_back();
return Ans;
}
詳細信息
answer.code: In function ‘void send_message(std::vector<bool>, std::vector<bool>)’: answer.code:24:48: error: ‘M’ was not declared in this scope 24 | if(!C[j]&&now<S)arr[j]=M[now++]; | ^