QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#884444 | #4675. Multiple Communications | chy_is_a_fish | 0 | 0ms | 0kb | C++14 | 1.3kb | 2025-02-06 08:22:19 | 2025-02-06 08:22:19 |
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 (num[i] & (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
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.