QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#75331 | #4675. Multiple Communications | wangzhe_0477 | 0 | 5ms | 3500kb | C++17 | 1.6kb | 2023-02-04 21:00:45 | 2023-02-04 21:00:46 |
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_64 random_base(1919810);
int main() {
for (int i = 0; i < 1000; i++) a[i] = UID<int>(0, (1 << 30) - 1)(random_base);
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;
}
puts("Not Found");
}
}
OUT:;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 5ms
memory: 3500kb
First Run Input
Alice 111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...
First Run Output
110010001001111011110011011000010010100111110111010100000111010100001110001111000101110111100100000111011010001001010110100110001101011011010100100011000101101010111110001011000010000111101011101011011010111101111100010110000100010110001001101010110111001110010101000111111110010011011110111100111101...
Second Run Input
Bob 00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...
Second Run Output
101111110001000100010110101100000101000111100010010111010010011001011101010001000100101011001001100100001010111011001111101001001011000011101111111001101101101101111110101110100110010110001111101000110101010110011011011111101101011001001001100010010001011011011000111101100010100110101001100000111111...
Third Run Input
Clara 110010001001111011110011011000010010100111110111010100000111010100001110001111000101110111100100000111011010001001010110100110001101011011010100100011000101101010111110001011000010000111101011101011011010111101111100010110000100010110001001101010110111001110010101000111111110010011011110111100...
Third Run Output
Not Found Not Found Not Found Not Found Not Found Not Found Not Found Not Found Not Found Not Found Not Found Not Found Not Found Not Found Not Found Not Found Not Found Not Found Not Found Not Found Not Found Not Found
Manager to Checker
WA Wrong Answer on Third Run: failed to read your solution
result:
wrong answer WA