QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#884495 | #4675. Multiple Communications | chy_is_a_fish | 0 | 0ms | 0kb | C++14 | 1.3kb | 2025-02-06 08:52:19 | 2025-02-06 08:52:21 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 3005, L = 1000, K = 100;
mt19937 rnd(23472347);
unsigned int R() {return (rnd() & ((1u << 30) - 1)) ^ 24352134u;}
string name;
unsigned int val[L], a[N], b[N];
string A, B, num, w;
int main()
{
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
cin >> name;
for (int i = 0; i < L; i++) val[i] = R();
if (name[0] != 'C')
{
for (int i = 1; i <= K; i++)
{
cin >> num; unsigned int ret = 0;
for (int j = 0; j < L; j++) if (num[j] == '1') 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 <= K; i++)
for (int j = 0; j < 30; j++) if (A[pa++] == '1') a[i] |= (1 << j);
for (int i = 1; i <= K; i++)
for (int j = 0; j < 30; j++) if (B[pb++] == '1') b[i] |= (1 << j);
for (int _ = 1; _ <= K; _++)
{
cin >> w; unsigned int ret = 0;
for (int j = 0; j < L; j++) if (w[j] == '1') ret ^= val[j];
for (pa = 1; pa <= K; pa++) for (pb = 1; pb <= K; pb++)
if (!(a[pa] ^ b[pb] ^ ret)) {cout << pa << " " << pb << "\n"; break;}
cout << n << " " << n << "\n";
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Instance #0 Judgement Failed
First Run Input
First Run Output
Second Run Input
Second Run Output
Third Run Input
Third Run Output
Manager to Checker
WA Wrong Answer on First Run: the length of the output should be exactly 3000.