QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#322133 | #4675. Multiple Communications | duongnc000 | 0 | 5ms | 5476kb | C++20 | 2.9kb | 2024-02-06 12:02:25 | 2024-02-06 12:02:26 |
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(chrono::high_resolution_clock().now().time_since_epoch().count());
int rand_range(int l, int r) {
return rng() % (r - l + 1) + 1;
}
string name;
int idx[] = {107, 138, 170, 176, 194, 236, 256, 298, 316, 319, 323, 433, 463, 523, 540, 541, 569, 579, 642, 646, 661, 668, 671, 723, 758, 790, 869, 894, 978, 988};
map<string, vector<pair<int, int>>> mp;
string a[105], b[105];
void cook() {
for (int i = 1; i <= 100; ++i) {
string s; cin >> s;
for (int j = 0; j < 30; ++j)
cout << s[idx[j]];
}
}
string conv(string x, string y) {
string res;
for (int i = 0; i < 30; ++i)
res.push_back(x[i] ^ y[i] ^ '0');
return res;
}
void eat() {
string aa, bb;
cin >> aa >> bb;
for (int i = 0; i < 3000; i += 30) {
string tmp;
for (int j = 0; j < 30; ++j)
tmp.push_back(aa[i + j]);
// cout << tmp << endl;
a[i / 30] = tmp;
}
for (int i = 0; i < 3000; i += 30) {
string tmp;
for (int j = 0; j < 30; ++j)
tmp.push_back(bb[i + j]);
// cout << tmp << endl;
b[i / 30] = tmp;
}
for (int i = 0; i < 100; ++i) for (int j = 0; j < 100; ++j) {
// cout << conv(a[i], b[j]) << endl;
mp[conv(a[i], b[j])].emplace_back(i, j);
}
for (int i = 1; i <= 100; ++i) {
string s, bs; cin >> s;
for (int j = 0; j < 30; ++j)
bs.push_back(s[idx[j]]);
// assert(mp.find(bs) != mp.end());
auto [u, v] = mp[bs][rand_range(0, isz(mp[bs]) - 1)];
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: 5ms
memory: 5476kb
First Run Input
Alice 111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...
First Run Output
000101111100010100111000100100100001100010101010011111101111010111110110101011110111100011011101101010001100101101011101100001101101110100011001110001010101011110001010000100000111111111010001011001110110101000111011000000001111000111000001111010011110010011000010110010100001101100011101010011011001...
Second Run Input
Bob 00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...
Second Run Output
101011110101000101001101000011000001011111011100110110101010000010001111000100100010110111001110001010111011001001011000001100100100000010010010100101000000111000101000001010011011011011100000000100110001101110011001100011001100110000111010011110100001011110011001001111110010101011001001101100100101...
Third Run Input
Clara 000101111100010100111000100100100001100010101010011111101111010111110110101011110111100011011101101010001100101101011101100001101101110100011001110001010101011110001010000100000111111111010001011001110110101000111011000000001111000111000001111010011110010011000010110010100001101100011101010011...
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