QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#48766#4675. Multiple CommunicationsRemocuz0 25ms3704kbC++201.6kb2022-09-15 19:27:392023-02-04 00:28:07

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:28:07]
  • 评测
  • 测评结果:0
  • 用时:25ms
  • 内存:3704kb
  • [2022-09-15 19:27:39]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fast_IO ios::sync_with_stdio(false);
#define DEBUG fprintf(stderr,"Running on Line %d in Function %s\n",__LINE__,__FUNCTION__)
mt19937 rnd(114514);
#define fir first
#define sec second
#define mod 998244353
#define ll long long
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f3f
inline int read()
{
	char ch=getchar(); int nega=1; while(!isdigit(ch)) {if(ch=='-') nega=-1; ch=getchar();}
	int ans=0; while(isdigit(ch)) {ans=ans*10+ch-48;ch=getchar();}
	if(nega==-1) return -ans;
	return ans;
}
typedef pair<int,int> pii;
void print(vector<int> x){for(int i=0;i<(int)x.size();i++) printf("%d%c",x[i]," \n"[i==(int)x.size()-1]);}
int pos[30][1005];
int val[30];
void init()
{
	for(int i=0;i<30;i++) for(int j=0;j<1000;j++) pos[i][j]=rnd()&1;
}
void encode()
{
	for(int i=0;i<100;i++)
	{
		string s; cin>>s;
		for(int j=0;j<30;j++)
		{
			int c=0;
			for(int k=0;k<1000;k++) c^=(s[k]-'0')&pos[j][k];
			putchar(c+'0');
		}
	}
	putchar('\n');
}
void decode()
{
	string A,B; cin>>A>>B;
	int Q=100;
	while(Q--)
	{
		string s; cin>>s;
		for(int j=0;j<30;j++)
		{
			int c=0;
			for(int k=0;k<1000;k++) c^=(s[k]-'0')&pos[j][k];
			val[j]=c;
		}
		for(int i=0;i<100;i++) for(int j=0;j<100;j++)
		{
			int ok=1;
			for(int k=0;k<30;k++)
			{
				int a=A[i*30+k]-'0',b=B[j*30+k]-'0';
				if(a^b^val[k]) ok=0;
			}
			if(ok) printf("%d %d\n",i,j);
		}
	}
}
signed main()
{
	Fast_IO;
	init();
	string opt; cin>>opt;
	if(opt=="Alice"||opt=="Bob") encode();
	else decode();
	return 0;
}



Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 25ms
memory: 3704kb

First Run Input

Alice
111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...

First Run Output

001000001010101101111010111100100011001001011100110011000100011010101011001101101111001101111001101010000001000001111100001011101100101101111101001101010111010001011001110100011000101101110111011111111011001100101100111100111110100000100010011101110101000000001110110000111101001000000101011100001101...

Second Run Input

Bob
00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...

Second Run Output

000110001011000111010010011101011101111011010100000111000000001001110001111100101010001011011011101010011000101011110000111011111101101100011000010100110110000011010000101010000011111110011011111111000010100011010111001001111011100101100101100001100100010010111000010100001110101100100101111010010101...

Third Run Input

Clara
001000001010101101111010111100100011001001011100110011000100011010101011001101101111001101111001101010000001000001111100001011101100101101111101001101010111010001011001110100011000101101110111011111111011001100101100111100111110100000100010011101110101000000001110110000111101001000000101011100...

Third Run Output

10 7
67 88
73 69
91 96
27 57
5 81
52 97
28 8
67 7
94 30
60 73
98 36
83 43
1 24
73 68
38 24
75 91
76 66
73 94
0 9
99 22
11 2
27 30
84 63
74 48
55 77
41 20
92 19
94 1
46 85
16 92
57 37
94 6
34 49
90 33
86 37
43 2
31 6
29 57
75 15
93 68
47 1
67 26
42 25
99 38
97 60
37 4
92 94
36 48
26 79
50 93
22 84
28...

Manager to Checker

WA
Wrong Answer on Third Run: index out of bounds

result:

wrong answer WA