QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#555609#9237. MessageModyKachef0 188ms3976kbC++231.4kb2024-09-10 06:13:012024-09-10 06:13:01

Judging History

你现在查看的是最新测评结果

  • [2024-09-10 06:13:01]
  • 评测
  • 测评结果:0
  • 用时:188ms
  • 内存:3976kb
  • [2024-09-10 06:13:01]
  • 提交

answer

#include "message.h"
#include <bits/stdc++.h>
using namespace std;


void send_message(std::vector<bool> M, std::vector<bool> C) {
  int S = M.size(); 
   for (auto i : C){
      vector<bool> A;
      for (int j = 0 ; j < 31 ; j++) A.push_back(i); 
      send_packet(A);
   }
   vector<int> bts;

   for (int i = 0 ; i < 31 ; i++){
     if (!C[i]) bts.push_back(i); 
   }
    vector<bool> a(31); 
   for (int i = 0 ; i < bts.size() ; i++){
      if ((S & (1<<i)) != 0) a[bts[i]] = 1;  
   }  
    send_packet(a); 
   reverse(M.begin() , M.end()); 
   vector<bool> m = M; 
   while(!m.empty()){
      vector<bool> pack(31);
      for (auto i : bts){
        if (m.empty()) continue;
         pack[i] = m.back();
         m.pop_back(); 
      }
      send_packet(pack); 
   }
}

std::vector<bool> receive_message(std::vector<std::vector<bool>> R) {
  vector<bool> ans;
  vector<int> bts;
  for (int i = 0 ; i <= 30 ; i++){
    int freq[2] = {};
    for (auto j : R[i]) freq[j]++;
    if (freq[1] <= 16) bts.push_back(i);
  }
  vector<bool> X = R[31]; 
  int S = 0;
  for (int i = 0 ; i < bts.size() ; i++){
    if (X[bts[i]]) S+= (1<<i); 
  }
  for (int i = 32 ; i < R.size() ; i++){
    for (auto j : bts){
      ans.push_back(R[i][j]); 
      if (ans.size() == S) break;
    }
    if (ans.size() == S) break;
  }
  return ans; 
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 81ms
memory: 3744kb

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: 188ms
memory: 3976kb

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