QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#50369 | #4675. Multiple Communications | zhouhuanyi | 0 | 2ms | 3768kb | C++11 | 1.3kb | 2022-09-25 17:35:23 | 2023-02-04 00:37:11 |
Judging History
answer
#include<iostream>
#include<cstdio>
#define N 3000
using namespace std;
int read()
{
char c=0;
int sum=0;
while (c<'0'||c>'9') c=getchar();
while ('0'<=c&&c<='9') sum=sum*10+c-'0',c=getchar();
return sum;
}
unsigned long long seed=12345,rd[N+1],A[N+1],B[N+1],delta[N+1];
int RAND()
{
seed=(seed<<7)^seed;
seed=(seed>>13)^seed;
seed=(seed<<17)^seed;
return seed%(1<<30);
}
string s,t,res;
int main()
{
for (int i=0;i<1000;++i) rd[i]=RAND();
cin>>s;
if (s=="Alice"||s=="Bob")
{
for (int i=0;i<100;++i)
{
cin>>t;
for (int j=0;j<1000;++j)
if (t[j]=='1')
delta[i]^=rd[j];
for (int j=0;j<30;++j) res=res+(((delta[i]>>j)&1)?'0':'1');
}
cout<<res<<endl;
}
else
{
cin>>t;
for (int i=0;i<100;++i)
for (int j=0;j<30;++j)
if (t[i*30+j]=='1')
A[i]^=(1<<j);
cin>>t;
for (int i=0;i<100;++i)
for (int j=0;j<30;++j)
if (t[i*30+j]=='1')
B[i]^=(1<<j);
for (int i=0;i<100;++i)
{
cin>>t;
for (int j=0;j<1000;++j)
if (t[j]=='1')
delta[i]^=rd[j];
}
for (int i=0,x,y;i<100;++i)
{
x=y=0;
for (int j=0;j<100;++j)
for (int k=0;k<100;++k)
if ((A[j]^B[k])==delta[i])
x=j,y=k;
printf("%d %d\n",x,y);
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3768kb
First Run Input
Alice 111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...
First Run Output
111100001111110011101001100011000111101110111000000001001110011110001000000011111011100001001101110001111100011111110100001100000010100011001011000110011100000111000101011010110111001010000101101011000000111111100010110101001110001100001011010110001011000011100011000010111001110010001000011000010110...
Second Run Input
Bob 00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...
Second Run Output
010110100111100110110111001001110111001101001001001011111111101111111011000110001011000101101100100110001110010001101010101011001101111000110111011011100101110001110011011100111000011011111110110110111100100011100011110100011000110010110010110010011100111101000111001001110101111110101000101000101001...
Third Run Input
Clara 111100001111110011101001100011000111101110111000000001001110011110001000000011111011100001001101110001111100011111110100001100000010100011001011000110011100000111000101011010110111001010000101101011000000111111100010110101001110001100001011010110001011000011100011000010111001110010001000011000...
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