QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#75210 | #4675. Multiple Communications | stkwill | 0 | 3ms | 3496kb | C++14 | 1.7kb | 2023-02-04 16:42:46 | 2023-02-04 16:42:51 |
Judging History
answer
#include <bits/stdc++.h>
const int T = 30;
const int N = 100;
const int L = 1000;
std::mt19937_64 Rand(1145141919810ll);
int Val[L], HashA[N], HashB[N];
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr), std::cout.tie(nullptr);
std::string Oper;
std::cin >> Oper;
for (int i = 0; i < L; ++i) Val[i] = Rand() & ((1 << T) - 1);
if (Oper == "Alice" || Oper == "Bob") {
for (int i = 0; i < N; ++i) {
int x = 0;
std::string s;
std::cin >> s;
for (int j = 0; j < L; ++j) x ^= s[j] == '1' ? Val[j] : 0;
for (int j = 0; j < T; ++j) std::cout << ((x >> j) & 1);
}
std::cout << '\n';
} else {
std::string s;
std::cin >> s;
for (int i = 0; i < N; ++i) {
for (int j = 0; j < T; ++j) HashA[i] |= (s[i * T + j] - '0') << j;
}
std::cin >> s;
for (int i = 0; i < N; ++i) {
for (int j = 0; j < T; ++j) HashB[i] |= (s[i * T + j] - '0') << j;
}
for (int i = 0; i < N; ++i) {
int x = 0;
std::cin >> s;
for (int j = 0; j < L; ++j) x ^= s[j] == '1' ? Val[j] : 0;
bool Flag = false;
for (int a = 0; a < N; ++a) {
for (int b = 0; b < N; ++b) {
if (Flag = HashA[a] ^ HashB[b] == x) {
std::cout << a + 1 << ' ' << b + 1 << '\n';
break;
}
}
if (Flag) break;
}
if (!Flag) std::cout << 1 << ' ' << 1 << '\n';
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 3ms
memory: 3496kb
First Run Input
Alice 111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...
First Run Output
001100010010101100111011010111110000111110111001111001111011111101000111001110101001111000100110001011001000000011010000110010001101110101010110001011001010010100000110001111101010111010100001001000011000100101100111111110110001000100000010101010011000010101100000000101101101110100001000011001110111...
Second Run Input
Bob 00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...
Second Run Output
001101100110111111100101100011101011111101110000100110101011101010001111011000110000000010001010000001011111101010100011100001010001010111000010010111110001001011000000001100000001101100110111110000011011111001010101101011000000010010100000111111111111100101000001000101100001111000110101101000110010...
Third Run Input
Clara 001100010010101100111011010111110000111110111001111001111011111101000111001110101001111000100110001011001000000011010000110010001101110101010110001011001010010100000110001111101010111010100001001000011000100101100111111110110001000100000010101010011000010101100000000101101101110100001000011001...
Third Run Output
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
Manager to Checker
WA You answered 0 (out of 100) questions correctly
result:
wrong answer WA