Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define double long double;
struct Complex{
    double r,i;
    Complex(double r,double i):r(r),i(i){}
    Complex(){}
	inline Complex operator + ( const Complex& rhs )  const  {
		return Complex ( r + rhs.r, i + rhs.i ) ;
	}
	inline Complex operator - ( const Complex& rhs )  const  {
		return Complex ( r - rhs.r, i - rhs.i ) ;
	}
	inline Complex operator * ( const Complex& rhs )  const  {
		return Complex ( r * rhs.r - i * rhs.i, r * rhs.i + i * rhs.r ) ;
	}
	inline void operator /= ( const double& x )   {
		r /= x, i /= x ;
	}
	inline void operator *= ( const Complex& rhs )   {
		*this = Complex ( r * rhs.r - i * rhs.i, r * rhs.i + i * rhs.r ) ;
	}
	inline void operator += ( const Complex& rhs )   {
		r += rhs.r, i += rhs.i ;
	}
};

const int maxn=4e6+6;
#define PI 3.14159265354
int pos[maxn];
void init ( const int& n )  {
    for ( int i = 0 ,j=0; i < n ; ++ i )  {
        pos[i]=j;for (int l = n >> 1; (j ^= l) < l; l >>= 1);
    }
}

void transform ( Complex *a, const int& n, bool inverse ) {
    for ( int i = 0; i < n ; ++ i ){
        if (i > pos[i]) std ::swap(a[i], a[pos[i]]);
    }

    for ( int l = 2 ; l <= n ; l <<= 1 )  {
        int m = l / 2;Complex omega={cos(2*PI/l),inverse?-sin(2*PI/l):sin(2*PI/l)};
        for ( Complex *p = a ; p != a + n ; p += l )  {
            Complex x={1,0};
            for ( int i = 0 ; i < m ; ++ i ,x *= omega)  {
                Complex t = x  * p [m + i] ;
                p [m + i] = p [i] - t ;p [i] += t ;
            }
        }
    }
}

void dft ( Complex *a, const int& n )  {
    transform ( a, n, 0 ) ;
}

void idft ( Complex *a, const int& n )  {
    transform ( a, n, 1) ;
    for ( int i = 0 ; i < n ; ++ i ) a [i] /= n ;
}
Complex A[maxn],B[maxn],C[maxn];
void FFT(int n,int m) {// len(A),len(B)
    int cnt=1;while(cnt<=(n+m)) cnt<<=1;
    init(cnt);dft(A,cnt);dft(B,cnt);
    for(int i=0;i<cnt;i++) C[i]=A[i]*B[i];
    idft(C,cnt);
    for(int i=0;i<=n+m;i++) C[i].r=ll(C[i].r+0.1);
}
const int mod=200003;
const int g=2;
std::vector<ll> pw(mod),rev(mod);
int main(){
	ll now=1;pw[0]=1;rev[1]=0;
	for(int i=1;i<mod-1;i++) {
		now=now*g%mod;pw[i]=now;
		rev[now]=i;
	}
	int n;cin>>n;
	ll ans=0;
	for(int i=1;i<=n;i++) {
		ll tem;cin>>tem;
		if(tem==0) continue;
		ans-=tem*tem%mod;
		A[rev[tem]].r+=1;
		B[rev[tem]].r+=1;
	}
	FFT(mod,mod);	
	for(int i=0;i<=2*mod;i++) {
		ll x=C[i].r;
		ans+=pw[i%(mod-1)]*x;
	}
	cout<<ans/2<<endl;
}

Compiler output:
a.cc:4:21: error: declaration does not declare anything [-fpermissive]
    4 | #define double long double;
      |                     ^~~~~~
a.cc:6:5: note: in expansion of macro 'double'
    6 |     double r,i;
      |     ^~~~~~
a.cc:6:12: error: 'r' does not name a type
    6 |     double r,i;
      |            ^
a.cc:4:27: error: expected ')' before ';' token
    4 | #define double long double;
      |                           ^
a.cc:7:13: note: in expansion of macro 'double'
    7 |     Complex(double r,double i):r(r),i(i){}
      |             ^~~~~~
a.cc:7:12: note: to match this '('
    7 |     Complex(double r,double i):r(r),i(i){}
      |            ^
a.cc:7:20: error: 'r' does not name a type
    7 |     Complex(double r,double i):r(r),i(i){}
      |                    ^
a.cc:7:29: error: 'i' does not name a type
    7 |     Complex(double r,double i):r(r),i(i){}
      |                             ^
a.cc:4:27: error: expected ')' before ';' token
    4 | #define double long double;
      |                           ^
a.cc:18:41: note: in expansion of macro 'double'
   18 |         inline void operator /= ( const double& x )   {
      |                                         ^~~~~~
a.cc:18:33: note: to match this '('
   18 |         inline void operator /= ( const double& x )   {
      |                                 ^
a.cc:18:49: error: ISO C++ forbids declaration of 'x' with no type [-fpermissive]
   18 |         inline void operator /= ( const double& x )   {
      |                                                 ^
a.cc:18:49: error: expected ';' at end of member declaration
   18 |         inline void operator /= ( const double& x )   {
      |                                                 ^
      |                                                  ;
a.cc:18:51: error: expected unqualified-id before ')' token
   18 |         inline void operator /= ( const double& x )   {
      |                                                   ^
a.cc: In constructor 'Complex::Complex()':
a.cc:8:5: error: uninitialized reference member in 'int&' [-fpermissive]
    8 |     Complex(){}
      |     ^~~~~~~
a.cc:18:49: note: 'int& Complex::x' should be initialized
   18 |         inline void operator /= ( const double& x )   {
      |                                                 ^
a.cc: In member function 'Complex Complex::operator+(const Complex&) const':
a.cc:10:34: error: 'r' was not declared in this scope
   10 |                 return Complex ( r + rhs.r, i + rhs.i ) ;
      |                                  ^
a.cc:10:42: error: 'const struct Complex' has no member named 'r'
   10 |                 return Complex ( r + rhs.r, i + rhs.i ) ;
      |                                          ^
a.cc:10:45: error: 'i' was not declared in this scope
   10 |                 return Complex ( r + rhs.r, i + rhs.i ) ;
      |                                             ^
a.cc:10:53: error: 'const struct Complex' has no member named 'i'
   10 |                 return Complex ( r + rhs.r, i + rhs.i ) ;
      |                                                     ^
a.cc: In member function 'Complex Complex::operator-(const Complex&) const':
a.cc:13:34: error: 'r' was not declared in this scope
   13 |                 return Complex ( r - rhs.r, i - rhs.i ) ;
      |                                  ^
a.cc:13:42: error: 'const struct Complex' has no member named 'r'
   13 |                 return Complex ( r - rhs.r, i - rhs.i ) ;
      |                                          ^
a.cc:13:45: error: 'i' was not declared in this scope
   13 |                 return Complex ( r - rhs.r, i - rhs.i ) ;
      |                                             ^
a.cc:13:53: error: 'const struct Complex' has no member named 'i'
   13 |                 return Complex ( r - rhs.r, i - rhs.i ) ;
      |                                                     ^
a.cc: In member function 'Complex Complex::operator*(const Complex&) const':
a.cc:16:34: error: 'r' was not declared in this scope
   16 |                 return Complex ( r * rhs.r - i * rhs.i, r * rhs.i + i * rhs.r ) ;
      |                                  ^
a.cc:16:42: error: 'const struct Complex' has no member named 'r'
   16 |                 return Complex ( r * rhs.r - i * rhs.i, r * rhs.i + i * rhs.r ) ;
      |                                          ^
a.cc:16:46: error: 'i' was not declared in this scope
   16 |                 return Complex ( r * rhs.r - i * rhs.i, r * rhs.i + i * rhs.r ) ;
      |                                              ^
a.cc:16:54: error: 'const struct Complex' has no member named 'i'
   16 |                 return Complex ( r * rhs.r - i * rhs.i, r * rhs.i + i * rhs.r ) ;
      |                                                      ^
a.cc:16:65: error: 'const struct Complex' has no member named 'i'
   16 |                 return Complex ( r * rhs.r - i * rhs.i, r * rhs.i + i * rhs.r ) ;
      |                                                                 ^
a.cc:16:77: error: 'const struct Complex' has no member named 'r'
   16 |                 return Complex ( r * rhs.r - i * rhs.i, r * rhs.i + i * rhs.r ) ;
      |                                                                             ^
a.cc: In member function 'void Complex::operator*=(const Complex&)':
a.cc:22:35: error: 'r' was not declared in this scope
   22 |                 *this = Complex ( r * rhs.r - i * rhs.i, r * rhs.i + i * rhs.r ) ;
      |                                   ^
a.cc:22:43: error: 'const struct Complex' has no member named 'r'
   22 |                 *this = Complex ( r * rhs.r - i * rhs.i, r * rhs.i + i * rhs.r ) ;
      |                                           ^
a.cc:22:47: error: 'i' was not declared in this scope
   22 |                 *this = Complex ( r * rhs.r - i * rhs.i, r * rhs.i + i * rhs.r ) ;
      |                                               ^
a.cc:22:55: error: 'const struct Complex' has no member named 'i'
   22 |                 *this = Complex ( r * rhs.r - i * rhs.i, r * rhs.i + i * rhs.r ) ;
      |                                                       ^
a.cc:22:66: error: 'const struct Complex' has no member named 'i'
   22 |                 *this = Complex ( r * rhs.r - i * rhs.i, r * rhs.i + i * rhs.r ) ;
      |                                                                  ^
a.cc:22:78: error: 'const struct Complex' has no member named 'r'
   22 |                 *this = Complex ( r * rhs.r - i * rhs.i, r * rhs.i + i * rhs.r ) ;
      |                                                                              ^
a.cc: In member function 'void Complex::operator+=(const Complex&)':
a.cc:25:17: error: 'r' was not declared in this scope
   25 |                 r += rhs.r, i += rhs.i ;
      |                 ^
a.cc:25:26: error: 'const struct Complex' has no member named 'r'
   25 |                 r += rhs.r, i += rhs.i ;
      |                          ^
a.cc:25:29: error: 'i' was not declared in this scope
   25 |                 r += rhs.r, i += rhs.i ;
      |                             ^
a.cc:25:38: error: 'const struct Complex' has no member named 'i'
   25 |                 r += rhs.r, i += rhs.i ;
      |                                      ^
a.cc: In function 'void transform(Complex*, const int&, bool)':
a.cc:40:35: error: no matching function for call to 'swap(Complex&, Complex&)'
   40 |         if (i > pos[i]) std ::swap(a[i], a[pos[i]]);
      |                         ~~~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:77,
                 from a.cc:1:
/usr/include/c++/14/any:430:15: note: candidate: 'void std::swap(any&, any&)' (near match)
  430 |   inline void swap(any& __x, any& __y) noexcept { __x.swap(__y); }
      |               ^~~~
/usr/include/c++/14/any:430:15: note:   conversion of argument 2 would be ill-formed:
a.cc:40:50: error: cannot bind non-const lvalue reference of type 'std::any&' to an rvalue of type 'std::any'
   40 |         if (i > pos[i]) std ::swap(a[i], a[pos[i]]);
      |                                          ~~~~~~~~^
/usr/include/c++/14/any:191:7: note:   after user-defined conversion: 'std::any::any(_Tp&&) [with _Tp = Complex&; _VTp = Complex; _Mgr = _Manager_internal<Complex>; typename std::enable_if<(is_copy_constructible_v<_VTp> && (! __is_in_place_type_v<_VTp>)), bool>::type <anonymous> = true]'
  191 |       any(_Tp&& __value)
      |       ^~~
In file included from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/stdexcept:38,
                 from /usr/include/c++/14/system_error:43,
                 from /usr/include/c++/14/bits/ios_base.h:46,
                 from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/bits/exception_ptr.h:229:5: note: candidate: 'void std::__exception_ptr::swap(exception_ptr&, exception_ptr&)'
  229 |     swap(exception_ptr& __lhs, exception_ptr& __rhs)
      |     ^~~~
/usr/include/c++/14/bits/exception_ptr.h:229:25: note:   no known conversion for argument 1 from 'Complex' to 'std::__exception_ptr::exception_ptr&'
  229 |     swap(exception_ptr& __lhs, exception_ptr& __rhs)
      |          ~~~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/future:51,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:176:
/usr/include/c++/14/bits/std_thread.h:328:3: note: candidate: 'void std::swap(thread&, thread&)'
  328 |   swap(thread& __x, thread& __y) noexcept
      |   ^~~~
/usr/include/c++/14/bits/std_thread.h:328:16: note:   no known conversion for argument 1 from 'Complex' to 'std::thread&'
  328 |   swap(thread& __x, thread& __y) noexcept
      |        ~~~~~~~~^~~
In file included from /usr/include/c++/14/bits/stl_pair.h:61,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/move.