QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#49227#4675. Multiple Communicationsiee0 5ms3616kbC++141.0kb2022-09-19 19:41:412023-02-04 00:35:41

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-04 00:35:41]
  • 评测
  • 测评结果:0
  • 用时:5ms
  • 内存:3616kb
  • [2022-09-19 19:41:41]
  • 提交

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[i * 100 + x] - '0', gB = B[i * 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:;
		}
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 5ms
memory: 3616kb

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
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