QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#324467 | #4675. Multiple Communications | hotboy2703 | 0 | 0ms | 0kb | C++14 | 1.7kb | 2024-02-10 19:46:13 | 2024-02-10 19:46:13 |
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);
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<<' '<<ans[sum].se<<'\n';
}
}
else{
string s;
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 ++)cout<<BIT(sum,i);
}
}
}
/*
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
*/
详细
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.