QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#324487 | #4675. Multiple Communications | hotboy2703 | 0 | 0ms | 0kb | C++14 | 1.8kb | 2024-02-10 19:55:24 | 2024-02-10 19:55:25 |
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{
string s;
ll cnt = 0;
while (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';
assert(0);
}
}
/*
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 #0 Time Limit Exceeded
First Run Input
Alice 111101001110010010001100100110111010100101011011100010101101001000010111100100110100000111101101111110010010000110000110111000111101010101011000000011011110000001000101110110101110010011110110110000100101110111000010010101010110011010001101100111001010100011001000100101100101010110000100001110...
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.