QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#75334#4675. Multiple Communicationswangzhe_04770 8ms3588kbC++171.6kb2023-02-04 21:07:322023-02-04 21:07:34

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 21:07:34]
  • 评测
  • 测评结果:0
  • 用时:8ms
  • 内存:3588kb
  • [2023-02-04 21:07:32]
  • 提交

answer

#include <bits/stdc++.h>

template<typename T>
using UID = std::uniform_int_distribution<T>;

std::string tag;
int a[1005], x[105], y[105];
std::mt19937_64 random_base(1145141);

int main() {
    for (int i = 0; i < 1000; i++) a[i] = UID<int>(0, (1 << 30) - 1)(random_base);
    std::cin >> tag;
    if (tag == "Alice" || tag == "Bob") {
        std::string ans{""};
        for (int i = 0; i < 100; i++) {
            std::string s;
            std::cin >> s;
            int now = 0;
            for (int j = 0; j < 1000; j++)
                if (s[j] == '1')
                    now ^= a[j];
            for (int j = 0; j < 30; j++) ans += '0' + (now >> j & 1);
        }
        std::cout << ans;
    }
    else {
        std::string a, b;
        std::cin >> a >> b;
        for (int i = 0; i < 100; i++) {
            for (int j = 0; j < 30; j++) {
                if (a[i * 30 + j] == '1') x[i] |= 1 << j;
                if (b[i * 30 + j] == '1') y[i] |= 1 << j;
            }
        }
        for (int i = 0; i < 100; i++) {
            std::string s;
            std::cin >> s;
            int now = 0;
            for (int j = 0; j < 1000; j++)
                if (s[j] == '1')
                    now ^= a[j];
            for (int j = 0; j < 100; j++)
                for (int k = 0; k < 100; k++)
                    if ((now ^ x[j] ^ y[k]) == 0) {
                        printf("%d %d\n", j + 1, k + 1);
                        goto OUT;
                    }
            printf("%d %d\n", 0, 0);
            OUT:;
        }
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 8ms
memory: 3588kb

First Run Input

Alice
111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...

First Run Output

010100010011001100000111111100110111101100001100011010110110101101110100001011110011010001000000001011000010000101111101111000001101111100101000011000111111010011000000111001101100010000100011000111011110001101010100110100111001101010011101010100010101001110001111011111010001010111000010101011010001...

Second Run Input

Bob
00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...

Second Run Output

001010010000111011100011110101101011010101011101100010010001101011111010011101011101010111110000111110010100100101100101001100111010001110001111011111101001010110100101010010000011110110101101110100011100100100110001010011001100001111000100111101110010001001010001001101011011110110110101011100010100...

Third Run Input

Clara
010100010011001100000111111100110111101100001100011010110110101101110100001011110011010001000000001011000010000101111101111000001101111100101000011000111111010011000000111001101100010000100011000111011110001101010100110100111001101010011101010100010101001110001111011111010001010111000010101011...

Third Run Output

0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0

Manager to Checker

WA
Wrong Answer on Third Run: index out of bounds

result:

wrong answer WA