QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#884461#4675. Multiple Communicationschy_is_a_fish0 2ms3712kbC++141.3kb2025-02-06 08:35:482025-02-06 08:35:49

Judging History

This is the latest submission verdict.

  • [2025-02-06 08:35:49]
  • Judged
  • Verdict: 0
  • Time: 2ms
  • Memory: 3712kb
  • [2025-02-06 08:35:48]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;
const int N = 3005, L = 30, K = 100;
mt19937 rnd(2347);
int R() {return rnd() & (1 << L) - 1;}
string name;
int num[N], val[L], a[N], b[N];
string A, B;
int main()
{
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> name;
    for (int i = 0; i < L; i++) val[i] = R();
    if (name[0] != 'C')
    {
        for (int i = 1; i <= K; i++) 
        {
            cin >> num[i]; int ret = 0;
            for (int j = 0; j < L; j++) if (num[i] & (1 << j)) ret ^= val[j];
            for (int j = 0; j < L; j++) cout << ((ret >> j) & 1);
        }
    }
    else
    {
        cin >> A >> B; int pa = 0, pb = 0;
        for (int i = 1; i <= K; i++)
            for (int j = 0; j < L; j++) if (A[pa++] == '1') a[i] |= (1 << j);
        for (int i = 1; i <= K; i++)
            for (int j = 0; j < L; j++) if (B[pb++] == '1') b[i] |= (1 << j);
        for (int _ = 1; _ <= K; _++)
        {
            int w; cin >> w;
            int ret = 0;
            for (int j = 0; j < L; j++) if (w & (1 << j)) ret ^= val[j];
            for (pa = 1; pa <= K; pa++) for (pb = 1; pb <= K; pb++)
                if (!(a[pa] ^ b[pb] ^ ret)) {cout << pa << " " << pb << "\n"; break;}
        } 
    }
    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3712kb

First Run Input

Alice
111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...

First Run Output

111000111010011110100101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

Second Run Input

Bob
00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...

Second Run Output

111000111010011110100101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

Third Run Input

Clara
111000111010011110100101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

Third Run Output

1 2
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 1
11 1
12 1
13 1
14 1
15 1
16 1
17 1
18 1
19 1
20 1
21 1
22 1
23 1
24 1
25 1
26 1
27 1
28 1
29 1
30 1
31 1
32 1
33 1
34 1
35 1
36 1
37 1
38 1
39 1
40 1
41 1
42 1
43 1
44 1
45 1
46 1
47 1
48 1
49 1
50 1
51 1
52 1
53 1
54 1
55 1
56 1
57 1
58 1
59 1
60 1
61 1
62 1...

Manager to Checker

WA
You answered 0 (out of 100) questions correctly

result:

wrong answer WA