QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#48855 | #4675. Multiple Communications | rayluo | 0 | 6ms | 3804kb | C++11 | 1.6kb | 2022-09-16 16:55:35 | 2023-02-04 00:31:24 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define in inline
#define ll long long
#define ep emplace_back
const int K=32,N=1e3+10;
in int read()
{
int w=0,r=1;
char ch=getchar();
while(!isdigit(ch)){if(ch=='-')r=-1;ch=getchar();}
while(isdigit(ch)){w=(w<<1)+(w<<3)+(ch^48);ch=getchar();}
return w*r;
}
int T=100;
string opt;
bool pd[32][1010],vl[32];
char s[1010],a[3010],b[3010];
mt19937 rng(19491001);
void solve1()
{
while(T--)
{
scanf("%s",(s+1));
for(int i=1;i<=30;i++)
{
int x=0;
for(int j=1;j<=1000;j++)x^=(s[j]-'0')&pd[i][j];
printf("%c",(char)(x+'0'));
}
puts("");
}
}
void solve2()
{
scanf("%s%s",(a+1),(b+1));
while(T--)
{
scanf("%s",(s+1));
for(int i=1;i<=30;i++)
{
vl[i]=0;
for(int j=1;j<=1000;j++)vl[i]^=(s[j]-'0')&pd[i][j];
}
bool mrk=0;
for(int i=1;i<=100;i++)
{
for(int j=1;j<=100;j++)
{
bool flg=1;
for(int k=1;k<=30;k++)if((a[(i-1)*30+k]^b[(j-1)*30+k])!=vl[k])flg=0;
if(flg)
{
printf("%d %d\n",i,j);
mrk=1;
break;
}
}
if(mrk)break;
}
}
}
int main()
{
// freopen("1.in","r",stdin);
// freopen(".out","w",stdout);
cin>>opt;
for(int i=1;i<=30;i++)for(int j=1;j<=1000;j++)pd[i][j]=rng()&1;
if(opt=="Alice"||opt=="Bob")solve1();
else solve2();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 6ms
memory: 3804kb
First Run Input
Alice 111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...
First Run Output
000100010100001010001100001100 011001100101001001110011011110 000111110001000101000000101011 111001010010000001110000111010 101000101110001100101001000111 110100000000111110011111001100 111011111110000111010011000110 011000110000110001011110111100 100001111010111010011011101100 111001000110011100010...
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.
result:
wrong answer WA