Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cstring> 
#include<cassert>
#include<cmath>
#include<sstream>
#include<fstream>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<stack>
#include<bitset>
using namespace std;
long long fail[200005],a[200005],mia[400005],b[200005],mib[400005];
int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++) {
		scanf("%lld",a+i);
		a[n+i]=a[i];
	}
	for(int i=0;i<n;i++) scanf("%lld",&b[i]);
	if(n==1){
		cout<<0<<" "<<(a[0]^b[0]);
		return 0;
	}
	for(int i=0;i<2*n-1;i++) mia[i]=a[i]^a[i+1];
	for(int i=0;i<n-1;i++) mib[i]=b[i]^b[i+1]; 
	mib[n-1]=-1;
	int pos=-1;
	fail[0]=-1;
	for(int i=1;i<n;i++){
		while(pos!=-1&&mib[pos+1]!=mib[i]) pos=fail[pos];
		if(mib[pos+1]==mib[i]) fail[i]=++pos; else fail[i]=pos=-1;
	}
	pos=-1;
	for(int i=0;i<2*n-2;i++){
		while(pos!=-1&&mib[pos+1]!=mia[i]) pos=fail[pos];
		if(mib[pos+1]==mia[i]) pos++;
		if(pos==n-2){
			printf("%lld %lld\n",(i-pos),(b[pos+1]^a[i+1]));
		}
	}
}#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cstring> 
#include<cassert>
#include<cmath>
#include<sstream>
#include<fstream>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<stack>
#include<bitset>
using namespace std;
long long fail[200005],a[200005],mia[400005],b[200005],mib[400005];
int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++) {
		scanf("%lld",a+i);
		a[n+i]=a[i];
	}
	for(int i=0;i<n;i++) scanf("%lld",&b[i]);
	if(n==1){
		cout<<0<<" "<<(a[0]^b[0]);
		return 0;
	}
	for(int i=0;i<2*n-1;i++) mia[i]=a[i]^a[i+1];
	for(int i=0;i<n-1;i++) mib[i]=b[i]^b[i+1]; 
	mib[n-1]=-1;
	int pos=-1;
	fail[0]=-1;
	for(int i=1;i<n;i++){
		while(pos!=-1&&mib[pos+1]!=mib[i]) pos=fail[pos];
		if(mib[pos+1]==mib[i]) fail[i]=++pos; else fail[i]=pos=-1;
	}
	pos=-1;
	for(int i=0;i<2*n-2;i++){
		while(pos!=-1&&mib[pos+1]!=mia[i]) pos=fail[pos];
		if(mib[pos+1]==mia[i]) pos++;
		if(pos==n-2){
			printf("%lld %lld\n",(i-pos),(b[pos+1]^a[i+1]));
		}
	}
}

Compiler output:
a.cc:47:2: error: stray '#' in program
   47 | }#include<iostream>
      |  ^
a.cc:47:3: error: 'include' does not name a type
   47 | }#include<iostream>
      |   ^~~~~~~
a.cc:63:11: error: redefinition of 'long long int fail [200005]'
   63 | long long fail[200005],a[200005],mia[400005],b[200005],mib[400005];
      |           ^~~~
a.cc:17:11: note: 'long long int fail [200005]' previously declared here
   17 | long long fail[200005],a[200005],mia[400005],b[200005],mib[400005];
      |           ^~~~
a.cc:63:24: error: redefinition of 'long long int a [200005]'
   63 | long long fail[200005],a[200005],mia[400005],b[200005],mib[400005];
      |                        ^
a.cc:17:24: note: 'long long int a [200005]' previously declared here
   17 | long long fail[200005],a[200005],mia[400005],b[200005],mib[400005];
      |                        ^
a.cc:63:34: error: redefinition of 'long long int mia [400005]'
   63 | long long fail[200005],a[200005],mia[400005],b[200005],mib[400005];
      |                                  ^~~
a.cc:17:34: note: 'long long int mia [400005]' previously declared here
   17 | long long fail[200005],a[200005],mia[400005],b[200005],mib[400005];
      |                                  ^~~
a.cc:63:46: error: redefinition of 'long long int b [200005]'
   63 | long long fail[200005],a[200005],mia[400005],b[200005],mib[400005];
      |                                              ^
a.cc:17:46: note: 'long long int b [200005]' previously declared here
   17 | long long fail[200005],a[200005],mia[400005],b[200005],mib[400005];
      |                                              ^
a.cc:63:56: error: redefinition of 'long long int mib [400005]'
   63 | long long fail[200005],a[200005],mia[400005],b[200005],mib[400005];
      |                                                        ^~~
a.cc:17:56: note: 'long long int mib [400005]' previously declared here
   17 | long long fail[200005],a[200005],mia[400005],b[200005],mib[400005];
      |                                                        ^~~
a.cc:64:5: error: redefinition of 'int main()'
   64 | int main(){
      |     ^~~~
a.cc:18:5: note: 'int main()' previously defined here
   18 | int main(){
      |     ^~~~