QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#884502#4675. Multiple CommunicationsPhang0 3ms3712kbC++141.4kb2025-02-06 08:53:382025-02-06 08:53:43

Judging History

This is the latest submission verdict.

  • [2025-02-06 08:53:43]
  • Judged
  • Verdict: 0
  • Time: 3ms
  • Memory: 3712kb
  • [2025-02-06 08:53:38]
  • Submitted

answer

#include<bits/stdc++.h>
#define rep1(i, a, b) for(int i = a; i <= b; ++i)
#define rep2(i, a, b) for(int i = a; i >= b; --i)
#define ll long long
#define ft first
#define sd second
#define pii pair <int, int>
#define ld long double
#define pb push_back
#define ptc putchar
#define debug puts("-----------------------------")
const int N = 1e3 + 10;
using namespace std;
string who; int hsh[N], val[2][N];
int num(string s) {
    int v = 0;
    rep1(j, 0, 999) if(s[j] == '1') v ^= hsh[j + 1];
    return v;
}
int main() {
    cin >> who;
    mt19937 rand(998244353);
    rep1(i, 1, 1000) hsh[i] = rand();
    if(who[0] ^ 'C') {
        string s;
        rep1(i, 1, 100) {
            cin >> s; int v = num(s);
            rep1(j, 0, 29) cout << (v >> j & 1); 
        }
    }
    else {
        string s[2]; cin >> s[0] >> s[1];
        rep1(k, 0, 1) {
            rep1(i, 1, 100) {
                int bg = (i - 1) * 30;
                rep1(j, bg, bg + 29) {
                    if(s[k][j] == '0') continue;
                    val[k][i] += 1 << (j - bg);
                }
            }
        }
        string t;
        rep1(i, 1, 100) {
            cin >> t; int v = num(t);
            rep1(j, 1, 100) rep1(k, 1, 100) {
                if(v == val[0][j] ^ val[1][k]) {
                    cout << j << ' ' << k << '\n';
                    goto nxt;
                }
            } nxt : ;
        }
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

First Run Input

Alice
111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...

First Run Output

000001001100100010001100011010001000111100111101000010010100100111100111111001111101100111110010011010110110001011011100001101001101010000001111000011101111010000010110001010000101010110010000010111001001000000000000000100110111001010100010011111010100000101100011010011000001101001001011101111000001...

Second Run Input

Bob
00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...

Second Run Output

010110101000010010111010010100110011100011111111010111010011100011110001000001110000010011000101111100101011100110101001110100111101011110010100011101101110001000110010001110111101011000011110100100101011010100100000111010110111010111000101001111000111101011100001001101110110110000101101001000101011...

Third Run Input

Clara
000001001100100010001100011010001000111100111101000010010100100111100111111001111101100111110010011010110110001011011100001101001101010000001111000011101111010000010110001010000101010110010000010111001001000000000000000100110111001010100010011111010100000101100011010011000001101001001011101111...

Third Run Output

1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
...

Manager to Checker

WA
You answered 0 (out of 100) questions correctly

result:

wrong answer WA