QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#885642#9237. MessageASnown0 270ms3840kbC++201.4kb2025-02-06 16:49:442025-02-06 16:49:47

Judging History

This is the latest submission verdict.

  • [2025-02-06 16:49:47]
  • Judged
  • Verdict: 0
  • Time: 270ms
  • Memory: 3840kb
  • [2025-02-06 16:49:44]
  • Submitted

answer

#include<bits/stdc++.h>
#include "message.h"
using namespace std;
using uint=unsigned int;
const int pL=32;
uint rnd() {
   static uint seed=2348932489;
   seed<<=7,seed>>=11,seed<<=17;
   return seed;
}
void send_message(vector<bool> M, vector<bool> C) {
   vector<bool> c(31,0);
   for(int l=0;l<pL;l++) {
      for(int i=0;i<=30;i++) c[i]=c[i]^(rnd()&1);
      send_packet(c);
   }
   vector<int> pos;
   for(int i=0;i<=30;i++) if(!C[i]) pos.emplace_back(i);
   M.emplace_back(1);
   int S=M.size();
   vector<bool> A(31);
   for(int i=0;i<S;i+=16) {
      for(int j=0;j<16;j++) A[pos[j]]=(i+j<S?M[i+j]:0);
      send_packet(A);
   }
}

vector<bool> receive_message(vector<vector<bool>> R) {
   int get_packet_pos=0;
   auto get_packet = [&]() {
      // assert(get_packet_pos!=R.size());
      return R[get_packet_pos++];
   };
   vector<bool> C(31,false);
   vector<bool> c(31,0);
   for(int l=0;l<pL;l++) {
      for(int i=0;i<=30;i++) c[i]=c[i]^(rnd()&1);
      auto A=get_packet();
      for(int i=0;i<=30;i++) C[i]=C[i]|(c[i]!=A[i]);
   }
   vector<int> pos;
   for(int i=0;i<=30;i++) if(!C[i]) pos.emplace_back(i);
   // assert(pos.size()==16);
   vector<bool> M;
   for(;get_packet_pos!=R.size();) {
      auto A=get_packet();
      for(int j=0;j<16;j++) M.emplace_back(A[pos[j]]);
   }
   while(!M.back()) M.pop_back(); M.pop_back();
   return M;
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 111ms
memory: 3840kb

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: 270ms
memory: 3840kb

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