QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#567042#9237. Messageaaaaa0 0ms0kbC++202.2kb2024-09-16 05:37:572024-09-16 05:37:58

Judging History

This is the latest submission verdict.

  • [2024-09-16 05:37:58]
  • Judged
  • Verdict: 0
  • Time: 0ms
  • Memory: 0kb
  • [2024-09-16 05:37:57]
  • Submitted

answer

#include <bits/stdc++.h>
#include "message.h"

using namespace std;

typedef long long ll;

vector<bool> info[67];
ll nxt[31];
bool bb[31];

void send_message(vector<bool> M, vector<bool> C) {
    M.push_back(true);
    while (M.size() <= 1024) {
        M.push_back(false);
    }
    for (ll i=1; i<67; i++) {
        info[i].resize(31);
    }
    ll prev, k=0;
    for (ll i=0; i<C.size(); i++) {
        if (!C[i]) {
            prev = i-31;
        }
    }
    for (ll i=0; i<C.size(); i++) {
        if (!C[i]) {
            ll distance = i-prev;
            for (ll j=1; j<distance; j++) {
                info[j][i] = 1;
            }
            for (ll j=distance+1; j<67; j++) {
                info[j][i] = M[k++];
            }
            prev = i;
        }
    }
    for (ll i=1; i<67; i++) {
        send_packet(info[i]);
    }
}

vector<bool> receive_message(vector<vector<bool>> R) {
    for (ll i=1; i<67; i++) {
        info[i] = R[i-1];
    }
    for (ll i=0; i<31; i++) {
        ll current = 1;
        while (current < 67 && info[current][i]) {
            ++current;
        }
        nxt[i] = (i+31-current%31)%31;
    }
    for (ll i=0; i<31; i++) {
        ll cycle = i;
        ll flag = 0;
        for (ll j=1; j<17; j++) {
            cycle = nxt[cycle];
            if (cycle == i) {
                if (j == 16) {
                    flag = 1;
                }
                else {
                    flag = -1;
                    break;
                }
            }
        }
        if (flag == 1) {
            cycle = i;
            for (ll j=1; j<17; j++) {
                cycle = nxt[cycle];
                bb[cycle] = 1;
            }
            break;
        }
    }
    
    vector<bool> answer;
    for (ll i=0; i<31; i++) {
        if (bb[i]) {
            ll current = 1;
            while (current < 67 && info[current][i]) {
                ++current;
            }
            for (ll j=current+1; j<67; j++) {
                answer.push_back(info[j][i]);
            }
        }
    }
    
    while (!answer.back()) {
        answer.pop_back();
    }
    answer.pop_back();
    return answer;
}

详细

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: