QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#49226 | #4675. Multiple Communications | iee | 0 | 0ms | 0kb | C++14 | 1.0kb | 2022-09-19 19:41:16 | 2023-02-04 00:35:38 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
mt19937 eng(229);
int main() {
string S;
cin >> S;
if (S[0] == 'A' || S[0] == '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 i = 0; i < 30; ++i) {
int w = W[i];
int gA = A[w * 100 + x] - '0', gB = B[w * 100 + x] - '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:;
}
}
}
詳細信息
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
001011001111110111001110101000111101011101010111010010010001001011100111110011001010111101110001110110110000001010011001110101111101010110110011110010110110101011100001101011001100010111110000000011110011100100001110000100000010110000110000101001000010101101110010010110000011101110001000100001111100...
Third Run Input
Clara 110101000110000000100011110111010100001100111111000011100011101111011110000011100100000101111001110001001000010000101000010110110111111011100000001110011101100011001101011000111011010010000100110100100000000001010111010011101001011011001110101111011100100100011010111101001010010100101111000110...
Third Run Output
1 1 1 1 1 1
Manager to Checker
WA Wrong Answer on Third Run: failed to read your solution