QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#322149#4675. Multiple Communicationsduongnc0000 2ms3828kbC++202.5kb2024-02-06 12:36:062024-02-06 12:36:06

Judging History

你现在查看的是最新测评结果

  • [2024-02-06 12:36:06]
  • 评测
  • 测评结果:0
  • 用时:2ms
  • 内存:3828kb
  • [2024-02-06 12:36:06]
  • 提交

answer

/*
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx2,fma,bmi,bmi2,sse4.2,popcnt,lzcnt")
*/

#include <bits/stdc++.h>
#define taskname ""
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define i64 long long
#define pb push_back
#define ff first
#define ss second
#define isz(x) (int)x.size()
using namespace std;

const int mxN = 2e5 + 5;
const int mod = 1e9 + 7;
const i64 oo = 1e18;

mt19937_64 rng(177013);

i64 rand_range(i64 l, i64 r) {
    return rng() % (r - l + 1) + 1;
}

string name;
int val[1005], a[1005], b[1005];
map<int, vector<pair<int, int>>> mp;

void prep() {
    for (int i = 0; i < 1000; ++i) val[i] = rng() & ((1 << 30) - 1);
}

void cook() {
    for (int i = 1; i <= 100; ++i) {
        string s; cin >> s; int res = 0;
        for (char ch : s) res ^= ch == '1' ? val[i] : 0;
        for (int i = 29; i >= 0; --i) cout << (res >> i & 1);
    }
}

void eat() {
    string aa, bb;
    cin >> aa >> bb;
    for (int i = 0; i < 3000; i += 30) {
        int tmp = 0;
        for (int j = 0; j < 30; ++j)
            tmp = tmp << 1 | (aa[i + j] - '0');
        a[i / 30] = tmp;
    }
    for (int i = 0; i < 3000; i += 30) {
        int tmp = 0;
        for (int j = 0; j < 30; ++j)
            tmp = tmp << 1 | (bb[i + j] - '0');
        b[i / 30] = tmp;
    }
    for (int i = 0; i < 100; ++i) for (int j = 0; j < 100; ++j) {
        mp[a[i] ^ b[j]].push_back({i, j});
    }
    for (int i = 1; i <= 100; ++i) {
        string s; cin >> s; int bs = 0;
        for (char ch : s) bs ^= ch == '1' ? val[i] : 0;
        auto [u, v] = mp[bs].front();
        cout << u + 1 << " " << v + 1 << "\n";
    }
}

void solve() {
    cin >> name;
    if (name == "Alice" or name == "Bob") cook();
    else eat();
}

signed main() {

#ifndef CDuongg
    if(fopen(taskname".inp", "r"))
        assert(freopen(taskname".inp", "r", stdin)), assert(freopen(taskname".out", "w", stdout));
#else
    freopen("bai3.inp", "r", stdin);
    freopen("bai3.out", "w", stdout);
    auto start = chrono::high_resolution_clock::now();
#endif

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1; //cin >> t;
    while(t--) solve();

#ifdef CDuongg
   auto end = chrono::high_resolution_clock::now();
   cout << "\n"; for(int i = 1; i <= 100; ++i) cout << '=';
   cout << "\nExecution time: " << chrono::duration_cast<chrono::milliseconds> (end - start).count() << "[ms]" << endl;
   cout << "Check array size pls sir" << endl;
#endif

}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

First Run Input

Alice
111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...

First Run Output

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

Second Run Input

Bob
00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...

Second Run Output

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

Third Run Input

Clara
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

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