QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#311102 | #4675. Multiple Communications | lefy | 0 | 1ms | 3864kb | C++14 | 1.3kb | 2024-01-21 21:45:21 | 2024-01-21 21:45:22 |
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("alice.in","r",stdin);
srand(1311307);
int cnm=(1<<15)-1;
for(int i=1;i<=1000;i++){
int a1=rand()&cnm,a2=rand()&cnm;
a[i]=(a1<<15)|a2;
//~ cout<<a[i]<<" ";
}
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: 3864kb
First Run Input
First Run Output
100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 ...
Second Run Input
Second Run Output
100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 ...
Third Run Input
Third Run Output
100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 100 1 ...
Manager to Checker
WA Wrong Answer on First Run: the length of the output should be exactly 3000.
result:
wrong answer WA