QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#48853#4675. Multiple Communicationsrayluo0 3ms3744kbC++111.6kb2022-09-16 16:52:282023-02-04 00:31:19

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-04 00:31:19]
  • 评测
  • 测评结果:0
  • 用时:3ms
  • 内存:3744kb
  • [2022-09-16 16:52:28]
  • 提交

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[i]-'0')&pd[i][j];
            printf("%c",(char)(x+'0'));
        }
    }
}
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[i]-'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: 3ms
memory: 3744kb

First Run Input

Alice
111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...

First Run Output

010001001100000000000000000000010000000000000100010000000000010000001000000000000001000000010001000000000000000001000000000000001100000100010001000000000001000101000100110000000000010000000000000100010001000000000001000101000100110000000000010001000100000000000001000000010000001101000000100000000000...

Second Run Input

Bob
00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...

Second Run Output

000000001000000000010000000000010001001100000000110001000000000001001100000000000001000000010001001001000100000001000000000000000001000100010000000000010000000001000100100001000000000001000100000000010001000000000001001100000000000000000000010001001000000000100000000000000001001100000100010000000000...

Third Run Input

Clara
010001001100000000000000000000010000000000000100010000000000010000001000000000000001000000010001000000000000000001000000000000001100000100010001000000000001000101000100110000000000010000000000000100010001000000000001000101000100110000000000010001000100000000000001000000010000001101000000100000...

Third Run Output

1 95
3 97
1 93
1 10
16 25
4 69
14 61
5 94
4 61
3 67
2 1
3 80
23 57
2 25
2 49
12 13
7 40
11 33
7 29
1 10
1 96
1 26
5 95
18 95
4 66
7 6
5 1
1 82
9 55
4 69
4 70
1 67
3 68
3 28
16 10
9 62
9 55
3 28
15 61
6 15
2 5
4 26
4 87
9 73
10 45
11 73
1 14
7 99
1 3
9 87
2 36
7 29
1 25
10 52
1 23
4 80
1 67
1 17
4 67...

Manager to Checker

WA
You answered 8 (out of 100) questions correctly

result:

wrong answer WA