QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#884496 | #4675. Multiple Communications | Shunpower | 0 | 0ms | 0kb | C++17 | 2.9kb | 2025-02-06 08:52:41 | 2025-02-06 08:52:42 |
Judging History
answer
//Author:Leftist_G / Shunpower
//Cloud Island & Rain Temperature
//May the force be with you and me.
#include <bits/stdc++.h>
#define ET return 0
#define fi first
#define se second
#define mp make_pair
#define pb emplace_back
#define ll long long
#define ull unsigned long long
#define inf INT_MAX
#define uinf INT_MIN
#define pii pair<int,int>
#define pll pair<ll,ll>
#define debug puts("--------Chery AK IOI--------");
#define Yes cout<<"Yes"<<endl;
#define No cout<<"No"<<endl;
#define pt puts("")
#define fr1(i,a,b) for(int i=a;i<=b;i++)
#define fr2(i,a,b) for(int i=a;i>=b;i--)
#define fv(i,p) for(int i=0;i<p.size();i++)
#define ld long double
#define il inline
#define ptc putchar
using namespace std;
const int N=1e5+10;
namespace Shun{
int lowbit(int x){
return x&-x;
}
template <typename T>
inline void read(T &x){
T s=0,w=1;
char ch=getchar();
while(ch<'0'||ch>'9'){
if(ch=='-'){
w=-1;
}
ch=getchar();
}
while(ch>='0'&&ch<='9'){
s=s*10+ch-'0';
ch=getchar();
}
x=s*w;
}
template <typename T>
inline void write(T x){
if(x<0){
putchar('-');
x=-x;
}
if(x>9){
write(x/10);
}
putchar(x%10+'0');
}
}
using namespace Shun;
string who;
string s;
int w[1010];
mt19937 rnd(20070720);
int a[101],b[101];
int main(){
#ifdef Shun
freopen(".in","r",stdin);
freopen(".out","w",stdout);
#endif
ios::sync_with_stdio(false);
cin>>who;
fr1(i,1,1000) w[i]=rnd()&((1<<30)-1);
if(who[0]!='C'){
string ans=0;
fr1(_,1,100){
cin>>s;
s='@'+s;
int hsh=0;
fr1(i,1,1000) if(s[i]=='1') hsh^=w[i];
fr1(i,0,29) ans+=((hsh>>i)&1)+'0';
}
cout<<ans<<endl;
}
else{
cin>>s;
s='@'+s;
fr1(i,1,3000){
int hsh=0;
fr1(j,i,i+29){
if(s[j]=='1') hsh+=(1<<j-i);
}
a[i/30+1]=hsh;
i+=29;
}
cin>>s;
s='@'+s;
fr1(i,1,3000){
int hsh=0;
fr1(j,i,i+29){
if(s[j]=='1') hsh+=(1<<j-i);
}
b[i/30+1]=hsh;
i+=29;
}
fr1(i,1,100){
cin>>s;
s='@'+s;
int hsh=0;
fr1(i,1,1000) if(s[i]=='1') hsh^=w[i];
fr1(j,1,100){
fr1(k,1,100){
if((a[j]^b[k])==hsh){
cout<<j<<" "<<k<<endl;
goto label;
}
}
}
label:
continue;
}
}
ET;
}
//ALL FOR Zhang Junhao.
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Instance #0 Runtime Error
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.