QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#49235 | #4675. Multiple Communications | iee | 0 | 0ms | 0kb | C++14 | 1.1kb | 2022-09-19 19:55:48 | 2023-02-04 00:36:08 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
mt19937 eng(922114514);
int main() {
freopen("clara.in", "r", stdin), freopen("clara.out", "w", stdout);
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[i * 100 + x] - '0', gB = B[i * 100 + y] - '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 #0 Dangerous Syscalls
First Run Input
First Run Output
Second Run Input
Second Run Output
Third Run Input
Third Run Output
Manager to Checker
WA Wrong Answer on First Run: the length of the output should be exactly 3000.