QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#311090 | #4675. Multiple Communications | lefy | 0 | 1ms | 3932kb | C++14 | 1.3kb | 2024-01-21 21:40:10 | 2024-01-21 21:40:11 |
answer
#include<bits/stdc++.h>
using namespace std;
const int N=1010;
int a[N],A[N],B[N];
char ch[10],b[N],c[N*3],d[N*3];
int main(){
//~ freopen("clara.in","r",stdin);
srand(1311307);
for(int i=1;i<=1000;i++){
a[i]=(rand()<<15)|rand();
}
scanf("%s",ch+1);
if(ch[1]=='A'||ch[1]=='B'){
int tot=0;
for(int i=1;i<=100;i++){
scanf("%s",b+1);int now=0;
for(int j=1;j<=1000;j++)if(b[j]=='1'){
now^=a[j];
}
for(int j=29;j>=0;j--)if(now&(1<<j))c[++tot]='1';else c[++tot]='0';
}
for(int i=1;i<=tot;i++)putchar(c[i]);
cout<<tot<<"*\n";
return 0;
}
scanf("%s%s",c+1,d+1);
int tot=1;
for(int i=1;i<=100;i++){
for(int j=1;j<=30;j++,tot++)A[i]<<=1,A[i]|=c[tot]-'0';
}
tot=1;
for(int i=1;i<=100;i++){
for(int j=1;j<=30;j++,tot++)B[i]<<=1,B[i]|=d[tot]-'0';
}
for(int id=1;id<=100;id++){
int ans=-1,ans2=-1,now=0;
scanf("%s",b+1);
for(int i=1;i<=1000;i++)if(b[i]=='1')now^=a[i];
for(int i=1;i<=100;i++)for(int j=1;j<=100;j++)if((A[i]^B[j])==now){
ans=i,ans2=j;break;
}
printf("%d %d\n",ans,ans2);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3932kb
First Run Input
Alice 111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...
First Run Output
011110100111001111010010011111001111000011111111101001101101110110111010100100100010001000100101001001110011011101101111101011011101101100101100011001010101010000100000010000100100000001110011100010010011001000110110101111110100101000100101011110011101111011110000011000000001111010110010010101010011...
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