QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#75336 | #4675. Multiple Communications | wangzhe_0477 | 0 | 7ms | 3564kb | C++17 | 1.5kb | 2023-02-04 21:11:07 | 2023-02-04 21:11:10 |
Judging History
answer
#include <bits/stdc++.h>
template<typename T>
using UID = std::uniform_int_distribution<T>;
std::string tag;
int a[1005], x[105], y[105];
std::mt19937 random_base(1145141);
int main() {
for (int i = 0; i < 1000; i++) a[i] = random_base() >> 2;
std::cin >> tag;
if (tag == "Alice" || tag == "Bob") {
std::string ans;
for (int i = 0; i < 100; i++) {
std::string s;
std::cin >> s;
int now = 0;
for (int j = 0; j < 1000; j++)
if (s[j] == '1')
now ^= a[j];
for (int j = 0; j < 30; j++) ans += '0' + (now >> j & 1);
}
std::cout << ans;
}
else {
std::string a, b;
std::cin >> a >> b;
for (int i = 0; i < 100; i++) {
for (int j = 0; j < 30; j++) {
if (a[i * 30 + j] == '1') x[i] |= 1 << j;
if (b[i * 30 + j] == '1') y[i] |= 1 << j;
}
}
for (int i = 0; i < 100; i++) {
std::string s;
std::cin >> s;
int now = 0;
for (int j = 0; j < 1000; j++)
if (s[j] == '1')
now ^= a[j];
for (int j = 0; j < 100; j++)
for (int k = 0; k < 100; k++)
if ((now ^ x[j] ^ y[k]) == 0) {
printf("%d %d\n", j + 1, k + 1);
goto OUT;
}
printf("%d %d\n", 0, 0);
OUT:;
}
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 7ms
memory: 3564kb
First Run Input
Alice 111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...
First Run Output
100010000001010010001010110101011101001111111110110011101100110010101011011101010101100110101011111001100011111000100110110000010110111011100110101001011111011000101010100011100110101010100110001000111101110101101001000101100010111000010010000110111001100000100101111100101101111100000101110101110000...
Second Run Input
Bob 00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...
Second Run Output
011001101101101101001110111011110001100111001100010001001110111101111010000010110000010000100110001110001100101000001010100001110001011100001100101111111100001100110001100011000110101101010011101000001001000001111111101110001111011110100001011010001101110110110111110010001000111001011101101001101110...
Third Run Input
Clara 100010000001010010001010110101011101001111111110110011101100110010101011011101010101100110101011111001100011111000100110110000010110111011100110101001011111011000101010100011100110101010100110001000111101110101101001000101100010111000010010000110111001100000100101111100101101111100000101110101...
Third Run Output
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Manager to Checker
WA Wrong Answer on Third Run: index out of bounds
result:
wrong answer WA