QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#555609 | #9237. Message | ModyKachef | 0 | 188ms | 3976kb | C++23 | 1.4kb | 2024-09-10 06:13:01 | 2024-09-10 06:13:01 |
Judging History
answer
#include "message.h"
#include <bits/stdc++.h>
using namespace std;
void send_message(std::vector<bool> M, std::vector<bool> C) {
int S = M.size();
for (auto i : C){
vector<bool> A;
for (int j = 0 ; j < 31 ; j++) A.push_back(i);
send_packet(A);
}
vector<int> bts;
for (int i = 0 ; i < 31 ; i++){
if (!C[i]) bts.push_back(i);
}
vector<bool> a(31);
for (int i = 0 ; i < bts.size() ; i++){
if ((S & (1<<i)) != 0) a[bts[i]] = 1;
}
send_packet(a);
reverse(M.begin() , M.end());
vector<bool> m = M;
while(!m.empty()){
vector<bool> pack(31);
for (auto i : bts){
if (m.empty()) continue;
pack[i] = m.back();
m.pop_back();
}
send_packet(pack);
}
}
std::vector<bool> receive_message(std::vector<std::vector<bool>> R) {
vector<bool> ans;
vector<int> bts;
for (int i = 0 ; i <= 30 ; i++){
int freq[2] = {};
for (auto j : R[i]) freq[j]++;
if (freq[1] <= 16) bts.push_back(i);
}
vector<bool> X = R[31];
int S = 0;
for (int i = 0 ; i < bts.size() ; i++){
if (X[bts[i]]) S+= (1<<i);
}
for (int i = 32 ; i < R.size() ; i++){
for (auto j : bts){
ans.push_back(R[i][j]);
if (ans.size() == S) break;
}
if (ans.size() == S) break;
}
return ans;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 81ms
memory: 3744kb
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
Wrong Answer
Test #8:
score: 0
Wrong Answer
time: 188ms
memory: 3976kb
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