QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#884446 | #4675. Multiple Communications | chy_is_a_fish | 0 | 0ms | 3584kb | C++14 | 1.3kb | 2025-02-06 08:23:07 | 2025-02-06 08:23:07 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 3005;
mt19937 rnd(23472347);
int R() {return rnd() & (1 << 30) - 1;}
string name;
int num[N], val[30], a[N], b[N];
string A, B;
int main()
{
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
cin >> name;
if (name[0] != 'C')
{
for (int i = 0; i < 30; i++) val[i] = R();
for (int i = 1; i <= 100; i++)
{
cin >> num[i]; int ret = 0;
for (int j = 0; j < 30; j++) if (num[i] & (1 << j)) ret ^= val[j];
for (int j = 0; j < 30; j++) cout << ((ret >> j) & 1);
}
}
else
{
cin >> A >> B; int pa = 0, pb = 0;
for (int i = 1; i <= 100; i++)
for (int j = 0; j < 30; j++) if (A[pa++] == '1') a[i] |= (1 << j);
for (int i = 1; i <= 100; i++)
for (int j = 0; j < 30; j++) if (B[pb++] == '1') b[i] |= (1 << j);
for (int _ = 1; _ <= 100; _++)
{
int w; cin >> w;
int ret = 0;
for (int j = 0; j < 30; j++) if (w & (1 << j)) ret ^= val[j];
for (pa = 1; pa <= 100; pa++) for (pb = 1; pb <= 100; pb++)
if (!(a[pa] ^ b[pb] ^ ret)) {cout << pa << " " << pb << "\n"; break;}
}
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3584kb
First Run Input
Alice 111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...
First Run Output
111101001001111110111001010011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
Second Run Input
Bob 00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...
Second Run Output
111101001001111110111001010011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
Third Run Input
Clara 111101001001111110111001010011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
Third Run Output
1 1 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2 13 2 14 2 15 2 16 2 17 2 18 2 19 2 20 2 21 2 22 2 23 2 24 2 25 2 26 2 27 2 28 2 29 2 30 2 31 2 32 2 33 2 34 2 35 2 36 2 37 2 38 2 39 2 40 2 41 2 42 2 43 2 44 2 45 2 46 2 47 2 48 2 49 2 50 2 51 2 52 2 53 2 54 2 55 2 56 2 57 2 58 2 59 2 60 2 61 2 62 2...
Manager to Checker
WA You answered 0 (out of 100) questions correctly
result:
wrong answer WA