QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#49219 | #4675. Multiple Communications | iee | 0 | 0ms | 0kb | C++11 | 993b | 2022-09-19 19:38:52 | 2023-02-04 00:35:29 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
mt19937 eng(229);
int main() {
string S;
cin >> S;
if (S[0] == 'A' || S[1] == 'B') {
string T[105];
for (int i = 1; i <= 100; ++i) cin >> T[i];
string out;
for (int i = 1; i <= 30; ++i) {
int w = eng() % 1000;
for (int j = 1; j <= 100; ++j) out += T[j][w];
}
cout << out;
} else {
string A, B;
cin >> A >> B;
vector<int> W;
for (int i = 1; i <= 30; ++i)
W.push_back(eng() % 1000);
int T = 100;
while (T--) {
string C;
cin >> C;
auto ok = [&] (int x, int y) {
x -= 1, y -= 1;
for (int w: W) {
int gA = A[x * 100 + w] - '0', gB = B[y * 100 + w] - '0';
if ((gA ^ gB) != C[w] - '0') {
return false;
}
}
return true;
};
for (int x = 1; x <= 100; ++x)
for (int y = 1; y <= 100; ++y)
if (ok(x, y)) {
cout << x << ' ' << y << '\n';
goto nxt;
}
cout << 1 << ' ' << 1 << '\n';
nxt:;
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Instance #2 Runtime Error
First Run Input
Alice 111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...
First Run Output
110101000110000000100011110111010100001100111111000011100011101111011110000011100100000101111001110001001000010000101000010110110111111011100000001110011101100011001101011000111011010010000100110100100000000001010111010011101001011011001110101111011100100100011010111101001010010100101111000110110101...
Second Run Input
Bob 00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...
Second Run Output
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Third Run Input
Third Run Output
Manager to Checker
WA Wrong Answer on Second Run: the length of the output should be exactly 3000.