QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#575181 | #9237. Message | maxrgby | 100 ✓ | 225ms | 4132kb | C++20 | 1.5kb | 2024-09-19 11:08:56 | 2024-09-19 11:08:58 |
Judging History
answer
// Source: https://kill.yourself/time/right-now
#include <bits/stdc++.h>
#include "message.h"
using namespace std;
void send_message(vector<bool> m, vector<bool> c){
int nxt[31];
for(int i = 0;i < 31;i++){
if(!c[i]){
for(int j = 1;j < 31;j++){
if(!c[(i+j)%31]){
nxt[i] = 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++){
if(c[i]){
continue;
}
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++){
vector<bool> tmp = send_packet(ret[i]);
}
}
vector<bool> receive_message(vector<vector<bool>> r){
assert(r.size() == 66);
assert(r[0].size() == 31);
int nxt[31];
for(int i = 0;i < 31;i++){
nxt[i] = 30;
for(int j = 0;j < 66;j++){
if(r[j][i]){
nxt[i] = (i+j+1)%31;
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(j < 15 and u == i){
u = -1;
break;
}
}
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++;
}
good = nxt[good];
}
char c = ret.back();
while(!ret.empty() and ret.back() == c){
ret.pop_back();
}
return ret;
}
详细
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 188ms
memory: 4132kb
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: 135ms
memory: 3780kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #3:
score: 10
Accepted
time: 225ms
memory: 3868kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #4:
score: 10
Accepted
time: 135ms
memory: 3828kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #5:
score: 10
Accepted
time: 113ms
memory: 3784kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #6:
score: 10
Accepted
time: 117ms
memory: 4084kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #7:
score: 10
Accepted
time: 120ms
memory: 3780kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Subtask #2:
score: 90
Accepted
Test #8:
score: 90
Accepted
time: 191ms
memory: 4064kb
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: 136ms
memory: 4036kb
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: 148ms
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: 220ms
memory: 3832kb
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: 171ms
memory: 4132kb
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: 130ms
memory: 4132kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #14:
score: 90
Accepted
time: 131ms
memory: 3784kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #15:
score: 90
Accepted
time: 98ms
memory: 4080kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #16:
score: 90
Accepted
time: 117ms
memory: 3840kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #17:
score: 90
Accepted
time: 190ms
memory: 4064kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #18:
score: 90
Accepted
time: 130ms
memory: 4128kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #19:
score: 90
Accepted
time: 142ms
memory: 3780kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #20:
score: 90
Accepted
time: 169ms
memory: 4068kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #21:
score: 90
Accepted
time: 192ms
memory: 4072kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #22:
score: 90
Accepted
time: 128ms
memory: 3840kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #23:
score: 90
Accepted
time: 208ms
memory: 4032kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #24:
score: 90
Accepted
time: 179ms
memory: 3788kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #25:
score: 90
Accepted
time: 182ms
memory: 3784kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #26:
score: 90
Accepted
time: 203ms
memory: 4056kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Test #27:
score: 90
Accepted
time: 181ms
memory: 3812kb
Manager to Aisha
Aisha to Manager
Manager to Basma
Basma to Manager
Manager to Checker
1
result:
points 1.0
Extra Test:
score: 0
Extra Test Passed