QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#563250#9237. MessageAndy_Lin0 1ms3832kbC++171.4kb2024-09-14 08:37:322024-09-14 08:37:33

Judging History

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

  • [2024-09-14 08:37:33]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3832kb
  • [2024-09-14 08:37:32]
  • 提交

answer

#include<bits/stdc++.h>
#include"message.h"
using namespace std;
void send_message(vector<bool>M,vector<bool>C){
  int pos=0;
  vector<bool>cs;
  for(int i=0;i<66;++i){
    cs.clear();
    for(int j=0;j<31;++j){
      if(C[j]||pos>=M.size()){cs.push_back(0);continue;}
      int k=0;
      for(;k<31;++k){
        if(!C[(j+k+1)%31])break;
      }
      if(i<k)cs.push_back(0);
      if(i==k)cs.push_back(1);
      cs.push_back(M[pos]);++pos;
    }
    send_packet(cs);
    if(pos>=M.size())return;
  }
}
vector<bool>receive_message(vector<vector<bool>>R){
  int dep[31],nxt[31];
  for(int i=0;i<31;++i)dep[i]=0,nxt[i]=0;
  for(int i=0;i<R.size();++i){
    for(int j=0;j<R[i].size();++j){
      if(nxt[j])continue;
      if(R[i][j]==1){
        nxt[j]=i+1;
      }
    }
  }
  bool tru[31];
  for(int i=0;i<31;++i)tru[i]=0;
  for(int i=0;i<31;++i){
    if(!dep[i]){
      int x=i;
      bool ok=0;
      while(1){
        if(dep[x+nxt[x]]){
          if(dep[(x+nxt[x])%31]+15==dep[x]){
            ok=1;break;
          }
        }
        dep[(x+nxt[x])%31]=dep[x]+1;
        x=(x+nxt[x])%31;
      }
      if(ok){
        for(int i=0;i<16;++i){
          tru[x]=1;x=(x+nxt[x])%31;
        }
      }
    }
  }
  vector<bool>cs={};
  for(int i=0;i<R.size();++i){
    for(int j=0;j<R[i].size();++j){
      if(!tru[j])continue;
      if(i>=nxt[j])cs.push_back(R[i][j]);
    }
  }
  return cs;
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3832kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

0
ing with message 'Packet size is incorrect'
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: 3788kb

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

0
ing with message 'Packet size is incorrect'
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