QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#885178 | #9237. Message | Phang | Compile Error | / | / | C++14 | 2.3kb | 2025-02-06 14:29:41 | 2025-02-06 14:29:43 |
Judging History
This is the latest submission verdict.
- [2025-02-06 14:29:43]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2025-02-06 14:29:41]
- Submitted
answer
#include<bits/stdc++.h>
// #include "message.h"
#define rep1(i, a, b) for(int i = a; i <= b; ++i)
#define rep2(i, a, b) for(int i = a; i >= b; --i)
#define ll long long
#define ft first
#define sd second
#define pii pair <int, int>
#define ld long double
#define pb push_back
#define ptc putchar
#define debug puts("-----------------------------")
using namespace std;
vector <bool> send_packet(vector <bool> A) ;
void send_message(vector <bool> M, vector <bool> C) {
M.pb(0); while(M.size() < 1025) M.pb(1);
vector <int> x(31, 0);
int lst = -1;
rep1(i, 0, 30) {
if(C[i]) continue;
else {
if(~lst) x[lst] = i - lst;
lst = i;
}
}
rep1(i, 0, 30) if(C[i]) continue;
else {x[lst] = 31 - lst + i; break;}
vector <bool> A(31, 0);
int tot = 0, cnt = 0;
rep1(i, 1, 66) {
rep1(j, 0, 30) {
if(C[j]) continue;
if(i < x[j]) A[j] = 0, ++cnt;
else if(i == x[j]) A[j] = 1, ++cnt;
else A[j] = M[tot++];
} send_packet(A);
// if(i <= 5) cout << cnt << ' ' << tot << '\n';
} //cout << cnt << ' ' << tot << '\n';
}
vector <bool> receive_message(vector <vector <bool>> R) {
vector <int> x(31, 0), vis(31, 0);
rep1(i, 0, 65) {
rep1(j, 0, 30) {
if(!R[i][j]) continue;
if(!x[j]) x[j] = i + 1;
}
}
vector <bool> ok(31, 0);
rep1(i, 0, 30) cout << x[i] << " \n"[i == 30];
// return ok;
rep1(i, 0, 30) {
if(vis[i]) continue;
int nw = i, num = 0;
while(!vis[nw]) {
vis[nw] = 1; ++num;
nw = (nw + x[nw]) % 31;
} if(num < 16) continue;
// cout << num << ' ' << nw << '\n';
while(vis[nw] < 2) {
vis[nw] = 2;
nw = (nw + x[nw]) % 31;
}
// return ok;
}
// rep1(i, 0, 30) cout << vis[i] << " \n"[i == 30];
vector <bool> M;
rep1(i, 0, 65) {
rep1(j, 0, 30) {
if(vis[j] < 2 || i < x[j]) continue;
M.pb(R[i][j]);
}
}
// cout << M.size() << '\n';
// cout << "terrible\n"; return ok;
while(true) {
int x = M.back(); M.pop_back();
if(!x) break;
}
return M;
}
// int main() {
// return 0;
// }
详细
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) { | ^~~