QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#322111#4675. Multiple Communicationsduongnc0000 0ms0kbC++202.4kb2024-02-06 11:40:572024-02-06 11:40:58

Judging History

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

  • [2024-02-06 11:40:58]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2024-02-06 11:40:57]
  • 提交

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;

string name;
int idx[] = {38, 54, 62, 67, 69, 106, 108, 110, 139, 144, 147, 176, 189, 191, 196};
map<bitset<15>, pair<int, int>> mp;
bitset<15> a[105], b[105];

void cook() {
    for (int i = 1; i <= 200; ++i) {
        string s; cin >> s;
        for (int j = 0; j < 15; ++j)
            cout << s[j];
    }
}

void eat() {
    string aa, bb;
    cin >> aa >> bb;
    for (int i = 0; i < 3000; i += 15) {
        bitset<15> tmp;
        for (int j = 0; j < 15; ++j)
            tmp[j] = aa[i + j] - '0';
        a[i / 15] = tmp;
    }
    for (int i = 0; i < 3000; i += 15) {
        bitset<15> tmp;
        for (int j = 0; j < 15; ++j)
            tmp[j] = bb[i + j] - '0';
        b[i / 15] = tmp;
    }
    for (int i = 0; i < 200; ++i) for (int j = 0; j < 200; ++j) {
        mp[a[i] ^ b[j]] = {i, j};
    }
    for (int i = 1; i <= 100; ++i) {
        string s; cin >> s;
        bitset<15> bs;
        for (int j = 0; j < 15; ++j)
            bs[j] = s[idx[j]] - '0';
        assert(mp.find(bs) != mp.end());
        auto [u, v] = mp[bs];
        cout << u << " " << v << "\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
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: