QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#885744#9237. MessageASnown0 206ms3840kbC++201.5kb2025-02-06 17:34:162025-02-06 17:34:23

Judging History

This is the latest submission verdict.

  • [2025-02-06 17:34:23]
  • Judged
  • Verdict: 0
  • Time: 206ms
  • Memory: 3840kb
  • [2025-02-06 17:34:16]
  • Submitted

answer

#include<bits/stdc++.h>
#include "message.h"
using namespace std;
using uint=unsigned int;
const int pL=8;
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> pri(31);
   for(int i=0;i<=30;i++) pri[i]=rnd()&1;
   vector<bool> c(31,0);
   for(int l=0;l<pL;l++) {
      for(int i=0;i<=30;i++) c[i]=c[i]^pri[i];
      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> pri(31);
   for(int i=0;i<=30;i++) pri[i]=rnd()&1;
   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]^pri[i];
      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;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 34ms
memory: 3712kb

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: 206ms
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