QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#559584 | #9237. Message | Insert_Username_Here | 0 | 188ms | 4080kb | C++20 | 1.5kb | 2024-09-12 01:02:04 | 2024-09-12 01:02:06 |
Judging History
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;
}
}
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 < 66 && !R[j][i]) j++;
nxt[i] = (j == 66) ? -1 : (i + j + 1) % 31;
}
int cur;
for(int i = 0; i < 31; i++) {
cur = i, j = 0;
while(cur >= 0 && j < 16) cur = nxt[cur], j++;
if(cur == i && j == 16) break;
}
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
Wrong Answer
Test #1:
score: 10
Accepted
time: 129ms
memory: 3724kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #2:
score: 10
Accepted
time: 124ms
memory: 3972kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #3:
score: 0
Wrong Answer
time: 175ms
memory: 3804kb
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
Instance #1 Runtime Error
Test #8:
score: 90
Accepted
time: 145ms
memory: 3812kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #9:
score: 90
Accepted
time: 133ms
memory: 3720kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #10:
score: 90
Accepted
time: 188ms
memory: 3788kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #11:
score: 90
Accepted
time: 188ms
memory: 3804kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #12:
score: 90
Accepted
time: 164ms
memory: 4080kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #13:
score: 90
Accepted
time: 135ms
memory: 3820kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #14:
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