QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#559591#9237. MessageInsert_Username_Here0 0ms0kbC++201.5kb2024-09-12 01:11:542024-09-12 01:11:54

Judging History

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

  • [2024-09-12 01:11:54]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2024-09-12 01:11:54]
  • 提交

answer

#include "message.h"
#include <bits/stdc++.h>
using namespace std;
void send_message(vector<bool> M, vector<bool> C) {
    int arr[16], cnt = 0;
    for(int i = 0; i < 31; i++) {
        if(!C[i]) arr[cnt++] = i;
    }
    vector<vector<bool>> msg(66, vector<bool>(31, 0));
    for(int i = 0; i < 15; i++) msg[arr[i + 1] - arr[i] - 1][arr[i]] = 1;
    msg[arr[0] + 30 - arr[15]][arr[15]] = 1;
    cnt = 0;
    M.push_back(1);
    while(M.size() < 1025) M.push_back(0);
    for(int i = 0; i < 16; i++) {
        int cur = 0;
        for(int j = 0; j < 66; j++) {
            if(cur) msg[j][arr[i]] = M[cnt++];
            if(msg[j][arr[i]]) cur = 1;
        }
    }
    assert(cnt == 1025);
    for(int i = 0; i < 66; i++) send_packet(msg[i]);
}

vector<bool> receive_message(vector<vector<bool>> R) {
    int nxt[31], arr[16], j;
    for(int i = 0; i < 31; i++) {
        j = 0;
        while(j < 17 && !R[j][i]) j++;
        nxt[i] = (j == 17) ? -1 : (i + j + 1) % 31;
    }
    int cur;
    for(int i = 0; i < 31; i++) {
        cur = i, j = 0;
        while(cur != i && cur >= 0 && j < 16) cur = nxt[cur], j++;
        if(cur == i && j == 16) break;
    }
    assert(j == 16);
    arr[0] = cur;
    for(int i = 1; i < 16; i++) arr[i] = nxt[arr[i - 1]];
    vector<bool> ans;
    for(int i = 0; i < 16; i++) {
        j = 0;
        while(!R[j][arr[i]]) j++;
        j++;
        while(j < 66) ans.push_back(R[j++][arr[i]]);
    }
    while(!ans.back()) ans.pop_back();
    ans.pop_back();
    return ans;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Instance #1 Runtime Error

Test #1:

score: 0
Instance #1 Runtime Error

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

0
ing with message 'manual RTE, cant read int from grader'
Quitting with result code 1

result:


Subtask #2:

score: 0
Instance #1 Runtime Error

Test #8:

score: 0
Instance #1 Runtime Error

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager


Manager to Checker

0
ing with message 'manual RTE, cant read int from grader'
Quitting with result code 1

result: