QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#580258 | #9237. Message | ljga_ | Compile Error | / | / | C++14 | 1.2kb | 2024-09-21 20:46:07 | 2024-09-21 20:46:08 |
Judging History
This is the latest submission verdict.
- [2024-09-21 20:46:08]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-09-21 20:46:07]
- Submitted
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void send_packet(vector<bool> A);
void send_message(vector<bool> M,vector<bool> C){
M.push_back(0);
while(M.size()<1025)
M.push_back(1);
vector<int> x(31);
vector<int> p;
for(int i=0;i<=31;i++)
if(C[i])
p.push_back(i);
for(int i=0;i<15;i++)
x[i]=p[i+1]-p[i];
x[p[15]]=31+p[0]-p[15];
int pos=0;
for(int t=0;t<66;t++){
vector<bool> m(31);
for(int i=0;i<31;i++){
if(x[i]){
if(x[i]==1)
m[i]=1;
else
m[i]=0;
x[i]--;
}
else{
m[i]=M[pos++];
}
}
send_packet(m);
}
}
vector<bool> receive_message(vector<vector<bool> > R){
vector<bool> f(31);
vector<int> x(31);
for(int t=0;t<66;t++){
for(int i=0;i<31;i++)
if(!f[i]){
x[i]++;
if(R[t][i])
f[i]=1;
}
}
vector<int> c(31);
for(int i=0;i<31;i++){
vector<bool> vis(31);
int cnt=0;
for(int u=i;!vis[u];u=(u+x[u])%31){
vis[u]=1;
cnt++;
}
if(cnt==16){
for(int u=i;cnt--;u=(u+x[u])%31)
c[u]=1;
break;
}
}
vector<bool> m;
for(int t=0;t<66;t++){
for(int i=0;i<31;i++){
if(t[i])
t[i]--;
else
m.push_back(R[t][i]);
}
}
return m;
}
详细
answer.code: In function ‘std::vector<bool> receive_message(std::vector<std::vector<bool> >)’: answer.code:66:29: error: invalid types ‘int[int]’ for array subscript 66 | if(t[i]) | ^ answer.code:67:34: error: invalid types ‘int[int]’ for array subscript 67 | t[i]--; | ^ stub.cpp: In function ‘int {anonymous}::sz(const C&)’: stub.cpp:27:52: error: ‘size’ is not a member of ‘std’; did you mean ‘size_t’? 27 | template<class C> int sz(const C& c) { return std::size(c); } | ^~~~ | size_t stub.cpp: In function ‘void {anonymous}::write_int_array(const int*, int)’: stub.cpp:70:13: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ 70 | if (int ret = fwrite(arr, sizeof(int), len, fout); len != ret) { | ^~~ stub.cpp: In function ‘void {anonymous}::read_int_array(int*, int)’: stub.cpp:105:13: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ 105 | if (int ret = fread(arr, sizeof(int), len, fin); len != ret) { | ^~~