QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#575078 | #9237. Message | maxrgby | 0 | 155ms | 4064kb | C++20 | 2.4kb | 2024-09-19 10:21:46 | 2024-09-19 10:21:50 |
Judging History
answer
// Source: https://kill.yourself/time/right-now
#include <bits/stdc++.h>
#include "message.h"
using namespace std;
// vector<vector<bool>> hehe;
// vector<bool> send_packet(vector<bool> e){
// for(int i = 2;i < 17;i += 1){
// e[i] = !e[i];
// }
// hehe.push_back(e);
// return e;
// }
void send_message(vector<bool> m, vector<bool> c){
//cout << "kill yourself" << endl;
// for(auto i : m){
// cout << i << " ";
// }
// cout << endl;
int nxt[31];
int diff = 0;
for(int i = 0;i < 31;i++){
nxt[i] = 66;
if(c[i]){
continue;
}
for(int j = 1;j < 31;j++){
if(!c[(i+j)%31]){
nxt[i] = j;
//cout << nxt[i] << " ";
diff += j;
break;
}
}
}
bool tmp = !m.back();
while(m.size() < 1025){
m.push_back(tmp);
}
vector<bool> ret[66];
for(int i = 0;i < 66;i++){
ret[i].resize(31);
}
int pos = 0;
for(int i = 0;i < 31;i++){
for(int j = 0;j < nxt[i]-1;j++){
ret[j][i] = 0;
}
ret[nxt[i]-1][i] = 1;
for(int j = nxt[i];j < 66;j++){
ret[j][i] = m[pos++];
}
}
// for(int i = 0;i < 66;i++){
// for(auto j : ret[i]){
// cout << j;
// }
// cout << endl;
// }
for(int i = 0;i < 66;i++){
send_packet(ret[i]);
}
}
vector<bool> receive_message(vector<vector<bool>> r){
int nxt[31];
for(int i = 0;i < 31;i++){
nxt[i] = 66;
for(int j = 0;j < 66;j++){
cout << r[j][i];
if(r[j][i]){
nxt[i] = (i+j+1)%31;
cout << nxt[i] << " ";
break;
}
}
}
int good = -1;
for(int i = 0;i < 31;i++){
int u = i;
for(int j = 0;j < 16;j++){
u = nxt[u];
}
if(u == i){
good = i;
break;
}
}
vector<bool> ret;
for(int i = 0;i < 16;i++){
int j = 0;
while(j < 66 and !r[j][good]){
j++;
}
j++;
while(j < 66){
ret.push_back(r[j][good]);
j++;
}
//cout << good << " ";
good = nxt[good];
}
char c = ret.back();
while(!ret.empty() and ret.back() == c){
ret.pop_back();
}
// for(auto i : ret){
// cout << i << " ";
// }
// cout << endl;
return ret;
}
// int main() {
// int n;
// cin >> n;
// vector<bool> a;
// vector<bool> c(31,0);
// for(int i = 0;i < n;i++){
// char c;
// cin >> c;
// a.push_back(c-'0');
// }
// for(int i = 2;i < 17;i += 1){
// c[i] = 1;
// }
// send_message(a,c);
// vector<bool> ans = receive_message(hehe);
// assert(ans == a);
// for(auto i : ans){
// cout << i << " ";
// }
// }
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 155ms
memory: 4064kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
11 000016 13 14 15 16 018 18 0000113 110 111 112 113 0115 115 116 117 0119 119 120 121 0123 123 124 00127 126 127 0129 129 130 10
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: 131ms
memory: 3840kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
012 12 00016 14 15 16 17 18 19 0111 111 0000116 113 114 115 116 117 0119 119 120 0122 122 0124 124 00127 126 127 128 129 010 10
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