QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#884444#4675. Multiple Communicationschy_is_a_fish0 0ms0kbC++141.3kb2025-02-06 08:22:192025-02-06 08:22:19

Judging History

This is the latest submission verdict.

  • [2025-02-06 08:22:19]
  • Judged
  • Verdict: 0
  • Time: 0ms
  • Memory: 0kb
  • [2025-02-06 08:22:19]
  • Submitted

answer

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Instance #0 Judgement Failed

First Run Input


First Run Output


Second Run Input


Second Run Output


Third Run Input


Third Run Output


Manager to Checker

WA
Wrong Answer on First Run: the length of the output should be exactly 3000.

result: