QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#885207#9237. MessagePhang0 198ms3712kbC++202.3kb2025-02-06 14:39:142025-02-06 14:39:14

Judging History

This is the latest submission verdict.

  • [2025-02-06 14:39:14]
  • Judged
  • Verdict: 0
  • Time: 198ms
  • Memory: 3712kb
  • [2025-02-06 14:39:14]
  • Submitted

answer

#include<bits/stdc++.h>
#include "message.h"
#define rep1(i, a, b) for(int i = a; i <= b; ++i)
#define rep2(i, a, b) for(int i = a; i >= b; --i)
#define ll long long
#define ft first
#define sd second
#define pii pair <int, int>
#define ld long double
#define pb push_back
#define ptc putchar
#define debug puts("-----------------------------")
using namespace std;

vector <bool> send_packet(vector <bool> A) ;

void send_message(vector <bool> M, vector <bool> C) {
    M.pb(0); while(M.size() < 1025) M.pb(1);
    vector <int> x(31, 0);
    int lst = -1;
    rep1(i, 0, 30) {
        if(C[i]) continue;
        else {
            if(~lst) x[lst] = i - lst;
            lst = i;
        }
    }
    rep1(i, 0, 30) if(C[i]) continue;
    else {x[lst] = 31 - lst + i; break;}
    vector <bool> A(31, 0);
    int tot = 0, cnt = 0;
    rep1(i, 1, 66) {
        rep1(j, 0, 30) {
            if(C[j]) continue;
            if(i < x[j]) A[j] = 0, ++cnt;
            else if(i == x[j]) A[j] = 1, ++cnt;
            else A[j] = M[tot++];
        } send_packet(A);
        // if(i <= 5) cout << cnt << ' ' << tot << '\n';
    } //cout << cnt << ' ' << tot << '\n';
}

vector <bool> receive_message(vector <vector <bool>> R) {
    vector <int> x(31, 0), vis(31, 0);
    rep1(i, 0, 65) {
        rep1(j, 0, 30) {
            if(!R[i][j]) continue;
            if(!x[j]) x[j] = i + 1;
        }
    }
    vector <bool> ok(31, 0);
    rep1(i, 0, 30) cout << x[i] << " \n"[i == 30];
    // return ok;
    rep1(i, 0, 30) {
        if(vis[i]) continue;
        int nw = i, num = 0;
        while(!vis[nw]) {
            vis[nw] = 1; ++num;
            nw = (nw + x[nw]) % 31;
        } if(num < 16) continue;
        // cout << num << ' ' << nw << '\n';
        while(vis[nw] < 2) {
            vis[nw] = 2;
            nw = (nw + x[nw]) % 31;
        }
        // return ok;
    }
    // rep1(i, 0, 30) cout << vis[i] << " \n"[i == 30];
    vector <bool> M;
    rep1(i, 0, 65) {
        rep1(j, 0, 30) {
            if(vis[j] < 2 || i < x[j]) continue;
            M.pb(R[i][j]);
        }
    }
    // cout << M.size() << '\n';
    // cout << "terrible\n"; return ok;
    while(true) {
        int x = M.back(); M.pop_back();
        if(!x) break;
    }
    return M;
}

// int main() {

//     return 0;
// }

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager

1 5 1 1 1 1 2 1 5 1 1 1 1 2 1 1 1 2 1 1 1 2 1 1 3 1 1 2 1 1 1

Manager to Checker

0
ing with message 'Possible tampering with sol2mgr[1]'
Sending secret with code DIE to mgr2sol[1]
Quitting with result code 11

result:

wrong output format Extra information in the output file

Subtask #2:

score: 0
Wrong Answer

Test #8:

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

Manager to Aisha


Aisha to Manager


Manager to Basma


Basma to Manager

2 1 4 1 1 1 1 1 1 2 1 5 1 1 1 1 1 2 1 1 2 1 2 1 3 1 1 1 1 2 1

Manager to Checker

0
ing with message 'Possible tampering with sol2mgr[1]'
Sending secret with code DIE to mgr2sol[1]
Quitting with result code 11

result:

wrong output format Extra information in the output file