Language: C++

#include<iostream>
#include<cmath>
#define LL long long
#define DB double
using namespace std;

const int M=2e5+3;
const DB pi=acos(-1.0);
struct XS
{
	double s,f;
}a[M<<2],b[M<<2];
XS operator +(XS x,XS y)
{
	XS t;
	t.s=x.s+y.s;
	t.f=x.f+y.f;
	return t;
}
XS operator -(XS x,XS y)
{
	XS t;
	t.s=x.s-y.s;
	t.f=x.f-y.f;
	return t;
}
XS operator *(XS x,XS y)
{
	XS t;
	t.s=x.s*y.s-x.f*y.f;
	t.f=x.s*y.f+x.f*y.s;
	return t;
}
int fftn;
int rank[M<<2];
void fft(XS *A,DB type)
{
	int i,j,k;
	for(i=0;i<fftn;i++)
		if(i<rank[i]) swap(A[i],A[rank[i]]);
	for(i=1;i<fftn;i<<=1)
	{
		XS t1; t1.s=cos(pi/i); t1.f=sin(pi/i)*type;
		for(j=0;j<fftn;j+=(i<<1))
		{
			XS t2; t2.s=1; t2.f=0;
			for(k=0;k<i;k++)
			{
				XS t3=A[k+j],t4=t2*A[k+j+i];
				A[k+j]=t3+t4;
				A[k+j+i]=t3-t4;
				t2=t2*t1;
			}
		}
	}
}
void mul(XS *A,XS *B,int l)
{
	int i,j=1;
	l<<=1;
	while((1<<j)<l) j++;
	for(i=0;i<(1<<j);i++)
		rank[i]=(rank[i>>1]>>1)|((i&1)<<(j-1));
	fftn=1<<j;
	fft(A,1); fft(B,1);
	for(i=0;i<fftn;i++)
		A[i]=A[i]*B[i];
	fft(A,-1);
}
int n;
LL ans=0;
int g[M+5],pow2[M+5];
int main()
{
	int i;
	LL j=1;
	for(i=0;i<M-1;i++)
	{
		g[j]=i;
		pow2[i]=j;
		j=j*2%M;
	}
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%d",&j);
		if(j==0) continue;
		a[g[j]].s+=1;
		b[g[j]].s+=1;
		ans-=j*j%M;
	}
	mul(a,b,M);
	for(i=0;i<fftn;i++)
		ans+=(LL)(a[i].s/fftn+0.5)*pow2[i%(M-1)];
	printf("%lld",ans>>1);
	return 0;
}

Compiler output:
a.cc: In function 'void fft(XS*, double)':
a.cc:40:22: error: reference to 'rank' is ambiguous
   40 |                 if(i<rank[i]) swap(A[i],A[rank[i]]);
      |                      ^~~~
In file included from /usr/include/c++/14/bits/move.h:37,
                 from /usr/include/c++/14/bits/exception_ptr.h:41,
                 from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/ios:41,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:35:5: note:                 'int rank [800012]'
   35 | int rank[M<<2];
      |     ^~~~
a.cc:40:43: error: reference to 'rank' is ambiguous
   40 |                 if(i<rank[i]) swap(A[i],A[rank[i]]);
      |                                           ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:35:5: note:                 'int rank [800012]'
   35 | int rank[M<<2];
      |     ^~~~
a.cc: In function 'void mul(XS*, XS*, int)':
a.cc:63:17: error: reference to 'rank' is ambiguous
   63 |                 rank[i]=(rank[i>>1]>>1)|((i&1)<<(j-1));
      |                 ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:35:5: note:                 'int rank [800012]'
   35 | int rank[M<<2];
      |     ^~~~
a.cc:63:26: error: reference to 'rank' is ambiguous
   63 |                 rank[i]=(rank[i>>1]>>1)|((i&1)<<(j-1));
      |                          ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
 1437 |     struct rank
      |            ^~~~
a.cc:35:5: note:                 'int rank [800012]'
   35 | int rank[M<<2];
      |     ^~~~