QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#561582 | #9237. Message | Crysfly | 0 | 148ms | 4032kb | C++17 | 2.1kb | 2024-09-13 00:16:56 | 2024-09-13 00:16:56 |
Judging History
answer
// what is matter? never mind.
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include "message.h"
//#pragma GCC target("sse,sse2,sse3,sse4,popcnt,abm,mmx,avx,avx2")
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
#define ll long long
//#define int long long
//#define ull unsigned long long
#define SZ(x) ((int)((x).size()))
#define ALL(x) (x).begin(),(x).end()
using namespace std;
inline int read()
{
char c=getchar();int x=0;bool f=0;
for(;!isdigit(c);c=getchar())f^=!(c^45);
for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
if(f)x=-x;return x;
}
#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;
#define maxn 200005
#define inf 0x3f3f3f3f
int c[33],dis[33];
int a[33][33];
void send_message(std::vector<bool> M, std::vector<bool> C){
M.pb(1);
For(i,0,30) c[i]=C[i];
For(i,0,30) if(!c[i]) {
int j=(i+1)%31; dis[i]=1;
while(c[j]) j=(j+1)%31,++dis[i];
}
int pos=0;
auto get=[&](){
if(pos==M.size()) M.pb(0);
return M[pos++];
};
For(s,0,30){
vector<bool>t;
For(i,0,30){
if(c[i]) t.pb(0);
else{
--dis[i];
if(dis[i]==0) t.pb(1);
else if(dis[i]>0) t.pb(0);
else t.pb(get());
}
}
send_packet(t);
}
while(pos<M.size()){
vector<bool>t;
For(i,0,30){
if(c[i]) t.pb(0);
else t.pb(get());
}
send_packet(t);
}
}
int to[33],vis[33],is[33];
std::vector<bool> receive_message(std::vector<std::vector<bool>> R){
vector<bool>res;
For(i,0,30){
For(s,0,30)
if(R[s][i]==1){
dis[i]=s+1;
to[i]=(i+1+s)%31;
break;
}
}
For(i,0,30)is[i]=0;
For(i,0,30){
memset(vis,0,sizeof vis);
vi o;
int u=i,ok=1;
For(j,0,15){
if(vis[u]){
ok=0;
break;
}
o.pb(u),vis[u]=1,u=to[u];
}
if(ok){
for(int x:o) is[x]=1;
break;
}
}
For(s,0,R.size()-1){
For(i,0,30)
if(is[i] && s>=dis[i]) res.pb(R[s][i]);
}
while(res.back()==0)res.pop_back();
res.pop_back();
return res;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 79ms
memory: 3824kb
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: 148ms
memory: 4032kb
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