QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#311096#4675. Multiple Communicationslefy0 2ms3972kbC++141.3kb2024-01-21 21:41:062024-01-21 21:41:09

Judging History

你现在查看的是最新测评结果

  • [2024-01-21 21:41:09]
  • 评测
  • 测评结果:0
  • 用时:2ms
  • 内存:3972kb
  • [2024-01-21 21:41:06]
  • 提交

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: 2ms
memory: 3972kb

First Run Input

Alice
111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...

First Run Output

011110100111001111010010011111001111000011111111101001101101110110111010100100100010001000100101001001110011011101101111101011011101101100101100011001010101010000100000010000100100000001110011100010010011001000110110101111110100101000100101011110011101111011110000011000000001111010110010010101010011...

Second Run Input

Bob
00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...

Second Run Output

100001000101001000011100110101111000011010101010010100101100111011100001111110110100111011110100011000001001101000001010100011111100000011010011100001000010010111111011101000010010101100001001101100101111011011111000011101000000010100100011010010011000010111111100101110101110001011100011010101000000...

Third Run Input

Clara
011110100111001111010010011111001111000011111111101001101101110110111010100100100010001000100101001001110011011101101111101011011101101100101100011001010101010000100000010000100100000001110011100010010011001000110110101111110100101000100101011110011101111011110000011000000001111010110010010101...

Third Run Output

11 8
-1 -1
74 70
-1 -1
28 58
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
77 67
-1 -1
-1 -1
-1 -1
12 3
-1 -1
85 64
75 49
-1 -1
-1 -1
93 20
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
35 50
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
43 26
-1 -1
-1 -1
38 5
-1 -1
-1 -1
-1 -1
51 ...

Manager to Checker

WA
Wrong Answer on Third Run: index out of bounds

result:

wrong answer WA