QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#554650 | #9237. Message | Eternatis | 0 | 0ms | 0kb | C++17 | 1.2kb | 2024-09-09 13:58:57 | 2024-09-09 13:58:58 |
answer
#include<bits/stdc++.h>
#include "message.h"
using namespace std;
#define pb push_back
#define vb vector<bool>
#define vi vector<int>
//vector<vb> now;
//void send_packet(vector<bool> v){
// now.pb(v);
//}
vb send_packet(vb a);
void send_message(vb M, vb C){
M.pb(1),M.resize(1025,0);
vi p,d(16);
for(int i=0;i<31;i++)if(!C[i])p.pb(i);
for(int i=0;i<16;i++)d[i]=(p[(i+1)%16]-p[i]+31)%31;
vector<vb> data(66,vb(31,0));
int pos=0;
for(int i=0;i<16;i++){
data[d[i]-1][p[i]]=1;
for(int j=d[i];j<66;j++)data[j][p[i]]=M[pos++];
}
for(int i=0;i<66;i++)send_packet(data[i]);
}
vb receive_message(vector<vb> R){
vi to(31),vis(31,0);
for(int i=0;i<31;i++){
to[i]=i;
for(int j=0;j<66;j++)
if(R[j][i]){
to[i]=(i+j+1)%31;
break;
}
}
vi p,tmp;
for(int i=0;i<31;i++){
if(vis[i])continue;
tmp.clear();
int now=i;
do{tmp.pb(now),now=to[now],vis[now]=1;}while(now!=i);
if(tmp.size()==16){
p=tmp;
break;
}
}
vb ans;
for(auto x:p)
for(int i=0;i<66;i++)
if(R[i][x]){
for(int j=i+1;j<66;j++)
ans.pb(R[j][x]);
break;
}
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
Instance #1 Time Limit Exceeded
Test #1:
score: 0
Instance #1 Time Limit Exceeded
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
result:
Subtask #2:
score: 0
Instance #1 Time Limit Exceeded
Test #8:
score: 0
Instance #1 Time Limit Exceeded
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