QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#819001 | #9237. Message | dongyc666# | 0 | 1ms | 4120kb | C++17 | 1018b | 2024-12-18 11:36:56 | 2024-12-18 11:36:57 |
Judging History
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<31;j++)
if(!C[j]&&now<S)arr[j]=Ans[now++];
send_packet(arr);
}
}
vector<bool> receive_message(vector<vector<bool> > R){
int s=0;
for(int i=0;i<R.size()-65;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()-65;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;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3764kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
0 ing with message 'Used too many days' Sending secret with code DIE to mgr2sol[0] 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: 1ms
memory: 4120kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
0 ing with message 'Used too many days' Sending secret with code DIE to mgr2sol[0] Sending secret with code DIE to mgr2sol[1] Quitting with result code 1
result:
wrong output format Extra information in the output file