QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#48904#4675. Multiple Communications5ab0 82ms3528kbC++141.6kb2022-09-16 22:09:392023-02-04 00:33:17

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:33:17]
  • 评测
  • 测评结果:0
  • 用时:82ms
  • 内存:3528kb
  • [2022-09-16 22:09:39]
  • 提交

answer

/* name: QOJ4675
 * author: 5ab
 * created at: 22-09-16 14:03
 */
#include <iostream>
#include <random>
#include <map>
using namespace std;

typedef long long ll;
const int max_n = 1000, max_c = 100, max_ts = 30, max_qr = 100;

char nm[6], a[max_n+1], res[max_c*max_ts+1];
int as[max_c], bs[max_c];
map<int, int> ans;

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	
	cin >> nm;
	if (nm[0] == 'A' || nm[0] == 'B')
	{
		for (int i = 0, par; i < max_c; i++)
		{
			default_random_engine d(1145141);
			uniform_int_distribution<int> u(0, 1);
			
			cin >> a;
			for (int c = 0; c < max_ts; c++)
			{
				par = 0;
				for (int j = 0; j < max_n; j++)
					par ^= (u(d) && a[j] == '1');
				res[i*max_ts+c] = par + '0';
			}
		}
		cout << res << endl;
	}
	else
	{
		cin >> res;
		for (int i = 0, pc = 0; i < max_c; i++)
			for (int j = 0; j < max_ts; j++, pc++)
				as[i] = (as[i] << 1) | (res[pc] - '0');
		cin >> res;
		for (int i = 0, pc = 0; i < max_c; i++)
			for (int j = 0; j < max_ts; j++, pc++)
				bs[i] = (bs[i] << 1) | (res[pc] - '0');
		
		for (int i = 0, pid = 0; i < max_c; i++)
			for (int j = 0; j < max_c; j++, pid++)
				ans[as[i]^bs[i]] = pid;
		
		for (int i = 0, par, qk; i < max_qr; i++)
		{
			default_random_engine d(1145141);
			uniform_int_distribution<int> u(0, 1);
			
			cin >> a;
			
			qk = 0;
			for (int c = 0; c < max_ts; c++)
			{
				par = 0;
				for (int j = 0; j < max_n; j++)
					par ^= (u(d) && a[j] == '1');
				qk = (qk << 1) | par;
			}
			
			par = ans[qk];
			cout << par / max_c + 1 << " " << par % max_c << "\n";
		}
	}
	
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 82ms
memory: 3528kb

First Run Input

Alice
111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...

First Run Output

101011000001001110011010101011110011001000111110110010111100111000111101000101001100100111010000001110100110111110100100011011010011111001001011101110100000110111100111110010111011010001110000100000000110010101100001010000101010010100101100010110100000111000111100110010001001010110001011011010001101...

Second Run Input

Bob
00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...

Second Run Output

100110111010111011011001110000110111001100100111101001011001010111110101101100001110010010111101001101100011101110100011100100100010000000111010010011000010101011010000101000101010101100100100101011110011110000010101010100000011001001100011110001011011100110011111011001110011011111001110100100110110...

Third Run Input

Clara
101011000001001110011010101011110011001000111110110010111100111000111101000101001100100111010000001110100110111110100100011011010011111001001011101110100000110111100111110010111011010001110000100000000110010101100001010000101010010100101100010110100000111000111100110010001001010110001011011010...

Third Run Output

1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
...

Manager to Checker

WA
Wrong Answer on Third Run: index out of bounds

result:

wrong answer WA