QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#75325#4675. Multiple Communicationswangzhe_0477Compile Error//C++171.5kb2023-02-04 20:52:212023-02-04 20:52:23

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 20:52:23]
  • 评测
  • [2023-02-04 20:52:21]
  • 提交

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(1919810);

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;
                    }
            OUT:
        }
    }
    return 0;
}

詳細信息

answer.code: In function ‘int main()’:
answer.code:49:9: error: expected primary-expression before ‘}’ token
   49 |         }
      |         ^