QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#324493 | #4675. Multiple Communications | hotboy2703 | 0 | 0ms | 0kb | C++14 | 1.9kb | 2024-02-10 19:59:48 | 2024-02-10 19:59:50 |
answer
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define pll pair <ll,ll>
#define fi first
#define se second
#define sz(a) (ll((a).size()))
#define BIT(mask,i) (((mask) >> (i))&1LL)
#define MASK(i) (1LL << (i))
mt19937_64 rng(1);
ll random(ll l,ll r){
return rng()%(r-l+1)+l;
}
ll myrandom(ll i){
return rng()%i;
}
ll val[1000];
ll a[100],b[100];
int main(){
ios_base::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);
// freopen("input.txt","r",stdin);
string task;
cin>>task;
if (task == "Clara"){
string s;
cin>>s;
for (ll i = 0;i < 100;i ++){
for (ll j = 0;j < 30;j ++){
a[i] += MASK(j) * (s[i*30+j] == '1');
}
}
cin>>s;
for (ll i = 0;i < 100;i ++){
for (ll j = 0;j < 30;j ++){
b[i] += MASK(j) * (s[i*30+j] == '1');
}
}
map <ll,pll> ans;
for (ll i = 0;i < 100;i ++){
for (ll j = 0;j < 100;j ++){
ans[a[i] ^ b[j]] = {i,j};
}
}
while (cin>>s){
ll sum = 0;
for (ll i = 0;i < 1000;i ++){
sum &= MASK(i%30)*(s[i]=='1');
}
cout<<ans[sum].fi+1<<' '<<ans[sum].se+1<<'\n';
}
}
else{
// assert(0);
string s;
ll cnt = 0;
for (ll t = 0;t < 100;t ++){
cin>>s;
ll sum = 0;
for (ll i = 0;i < 1000;i ++){
sum ^= MASK(i%30)*(s[i]=='1');
}
for (ll i = 0;i < 30;i ++){cnt++;cout<<BIT(sum,i);}
}
cout<<'\n';
}
}
/*
Flim
20 5
00101011011110111001
4 8 11 16 17
0 1 1 1 1
Flam
20 5
11000111101000011010
1 7 12 15 20
0 1 1 1 1
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Instance #2 Time Limit Exceeded
First Run Input
Alice 111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...
First Run Output
011111101000000011011100011111010001101001010001101000001000011110101010101111110011100010010110110111000100100010001100101101101110001110001110101010000010110111101001011011001111100100001011000101101001110100100010110111100110011111001110111111010110000110011100111111111110111110100010100111000010...
Second Run Input
Bob 00000011100010001101011001011110011000101110001001000111010100011010001011101011100001110101110110110101111101110000110101010101000111101000110110001000010010100100100000110101000110110110111110100000101111101010100111000111100011000011111000000110000101101101001100111010001110110001101011101111...
Second Run Output
100111101011101001001111111101101011001100110110111011101011000111110011110110111001111000000011011111111010001111000001010001100011101001000101101100111000010111010110101111101000001011101110100100100011100000001000101010010110111101110100011011000110111110011000111001001101100001101001000111010000...
Third Run Input
Clara 011111101000000011011100011111010001101001010001101000001000011110101010101111110011100010010110110111000100100010001100101101101110001110001110101010000010110111101001011011001111100100001011000101101001110100100010110111100110011111001110111111010110000110011100111111111110111110100010100111...
Third Run Output
Manager to Checker
WA Wrong Answer on Third Run: failed to read your solution