QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#48837 | #4675. Multiple Communications | 5ab | 0 | 80ms | 3420kb | C++11 | 1.6kb | 2022-09-16 14:20:17 | 2023-02-04 00:30:23 |
Judging History
answer
/* name: QOJ4675
* author: 5ab
* created at: 22-09-16 14:03
*/
#include <iostream>
#include <random>
#include <map>
using namespace std;
typedef long long ll;
const int max_n = 1000, max_c = 100, max_ts = 30, max_qr = 100;
char nm[6], a[max_n+1], res[max_c*max_ts+1];
int as[max_c], bs[max_c];
map<int, int> ans;
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cin >> nm;
if (nm[0] == 'A' || nm[0] == 'B')
{
for (int i = 0, par; i < max_c; i++)
{
default_random_engine d(1145141);
uniform_int_distribution<int> u(0, 1);
cin >> a;
for (int c = 0; c < max_ts; c++)
{
par = 0;
for (int j = 0; j < max_n; j++)
par ^= (u(d) && a[i] == '1');
res[i*max_ts+c] = par + '0';
}
}
cout << res << endl;
}
else
{
cin >> res;
for (int i = 0, pc = 0; i < max_c; i++)
for (int j = 0; j < max_ts; j++, pc++)
as[i] = (as[i] << 1) | (res[pc] - '0');
cin >> res;
for (int i = 0, pc = 0; i < max_c; i++)
for (int j = 0; j < max_ts; j++, pc++)
bs[i] = (bs[i] << 1) | (res[pc] - '0');
for (int i = 0, pid = 0; i < max_c; i++)
for (int j = 0; j < max_c; j++, pid++)
ans[as[i]^bs[i]] = pid;
for (int i = 0, par, qk; i < max_qr; i++)
{
default_random_engine d(1145141);
uniform_int_distribution<int> u(0, 1);
cin >> a;
qk = 0;
for (int c = 0; c < max_ts; c++)
{
par = 0;
for (int j = 0; j < max_n; j++)
par ^= (u(d) && a[i] == '1');
qk = (qk << 1) | par;
}
par = ans[qk];
cout << par / max_c + 1 << " " << par % max_c << "\n";
}
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 80ms
memory: 3420kb
First Run Input
Alice 111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...
First Run Output
001101101010110000011000100110001101101010110000011000100110000000000000000000000000000000000000000000000000000000000000001101101010110000011000100110001101101010110000011000100110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001101101010110000011000100110...
Second Run Input
Bob 00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...
Second Run Output
000000000000000000000000000000001101101010110000011000100110001101101010110000011000100110000000000000000000000000000000001101101010110000011000100110000000000000000000000000000000001101101010110000011000100110001101101010110000011000100110001101101010110000011000100110001101101010110000011000100110...
Third Run Input
Clara 001101101010110000011000100110001101101010110000011000100110000000000000000000000000000000000000000000000000000000000000001101101010110000011000100110001101101010110000011000100110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001101101010110000011000...
Third Run Output
97 99 100 99 100 99 97 99 97 99 97 99 100 99 100 99 97 99 100 99 97 99 100 99 100 99 100 99 100 99 97 99 97 99 97 99 100 99 97 99 97 99 97 99 97 99 97 99 97 99 97 99 100 99 100 99 100 99 100 99 100 99 100 99 97 99 97 99 97 99 97 99 97 99 97 99 100 99 97 99 97 99 100 99 97 99 100 99 97 99 97 99 100 9...
Manager to Checker
WA You answered 0 (out of 100) questions correctly
result:
wrong answer WA