QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#321894 | #4675. Multiple Communications | Skyan | 0 | 3ms | 3844kb | C++23 | 1.6kb | 2024-02-05 20:58:58 | 2024-02-05 20:58:58 |
answer
#include <iostream>
using namespace std;
int mod = (1 << 30) - 1, p[1005], c[1005], d[1005];
int main() {
string s;
cin >> s;
p[0] = 1;
for (int i = 1; i <= 1000; i++) p[i] = p[i - 1] * 2 % mod;
if (s != "Clara") {
for (int i = 1; i <= 100; i++) {
string t;
cin >> t;
int res = 0;
for (int i = t.size() - 1; i >= 0; i--) {
res ^= (t[i] - '0') * p[t.size() - i - 1];
}
for (int j = 0; j < 30; j++) {
if (res & (1 << j)) {
cout << 1;
}
else cout << 0;
}
}
}
else {
string a, b;
cin >> a >> b;
for (int i = 1; i <= 100; i++) {
for (int j = 0; j <= 29; j++) {
c[i] += (a[(i - 1) * 100 + j] - '0') * p[j];
d[i] += (b[(i - 1) * 100 + j] - '0') * p[j];
}
}
for (int i = 1; i <= 100; i++) {
string t;
cin >> t;
int res = 0;
for (int i = t.size() - 1; i >= 0; i--) {
res ^= (t[i] - '0') * p[t.size() - i - 1];
}
for (int j = 1; j <= 100; j++) {
int flag = 0;
for (int k = 1; k <= 100; k++) {
if ((c[j] ^ d[k]) == res) {
cout << j << " " << k << '\n';
flag = 1;
break;
}
}
if (flag == 1) break;
}
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 3ms
memory: 3844kb
First Run Input
Alice 111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...
First Run Output
010111111011111000111011000000010110001000010000010110001010010101111001000111001111110101101101101000110001000100100011110110110101010101110001110001101101000011110011011010010111010000100100101110010110100011101101000101110011111001100111101011111111111100111001100001111101111101000011100101000101...
Second Run Input
Bob 00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...
Second Run Output
010111100110111111110010010111110011010111010111011101101100001111100000011110011101101111111011000010000011110001011111000110001000110110100010010111101000011100010111110101101011110111010000000111000100100101010100010000101110111101101001100011011010011100011001111101000110110000001011100010010110...
Third Run Input
Clara 010111111011111000111011000000010110001000010000010110001010010101111001000111001111110101101101101000110001000100100011110110110101010101110001110001101101000011110011011010010111010000100100101110010110100011101101000101110011111001100111101011111111111100111001100001111101111101000011100101...
Third Run Output
7 10
Manager to Checker
WA Wrong Answer on Third Run: failed to read your solution
result:
wrong answer WA