QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#75335#4675. Multiple Communicationswangzhe_04770 3ms3600kbC++171.6kb2023-02-04 21:08:272023-02-04 21:08:29

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:08:29]
  • 评测
  • 测评结果:0
  • 用时:3ms
  • 内存:3600kb
  • [2023-02-04 21:08:27]
  • 提交

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] = random_base() >> 2;
    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;
}

详细

Test #1:

score: 0
Wrong Answer
time: 3ms
memory: 3600kb

First Run Input

Alice
111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...

First Run Output

001011101000110001100101001000101010010110010100010110001000111010100011100011101100101110111011111011011011010000110100111111110010000000010101001111010000011101110111010100110101100100101010111111001010000011011010000111101001001101011000001110011100100011011100100011100010011011011111011010011101...

Second Run Input

Bob
00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...

Second Run Output

110000001011011100100101101001001111111011110111101111000110110011000011000110111100000101011110101000101010110010100010101101101011001010100101110111100010001010001111101011111101100101010111001000000110010100110110111110100011101001110011100010000101101111101010100000110111100011100000000110101101...

Third Run Input

Clara
001011101000110001100101001000101010010110010100010110001000111010100011100011101100101110111011111011011011010000110100111111110010000000010101001111010000011101110111010100110101100100101010111111001010000011011010000111101001001101011000001110011100100011011100100011100010011011011111011010...

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
0 0
0 0

Manager to Checker

WA
Wrong Answer on Third Run: index out of bounds

result:

wrong answer WA