Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

// Can't use x and y for first and second
#define x real()
#define y imag()
#define X first
#define Y second
#define cpt const Pt&
//#define Pt Pt//const Pt&

//#define double long double
const double EPS = 1e-9;
const double pi=acos(-1);
bool deq(double a,double b) {return abs(a-b)<EPS;}
enum Orientation {CCW, CW, CNEITHER};

typedef complex<double> cpx;

struct Pt : public cpx {
    Pt() = default;
	using cpx::cpx;
	Pt(cpx a) : cpx(a) {}
    double& x const {
        return (double&)*this;
    }
    double& y const {
        return ((double*)this)[1];
    }

	bool operator ==(cpt b) const {return abs(*this-b) < EPS; }
	//by x first then break ties with y
	bool operator <(cpt b) const {return x<b.x || (x==b.x && y<b.y); }

	// Compare by arg then by norm (approximate)
	// arg is in range (-pi,pi].
	// Compare by arg then by norm (exact)
};

//Allow points to be read in by input streams
istream& operator >>(istream& is, Pt& p) {
	return is >> p.x >> p.y;
}

double dot(cpt a, cpt b) {return (conj(a) * b).x;}// Dot product
double det(cpt a, cpt b) {return (conj(a) * b).y;}//Determinant/"Cross Product"
double angle(cpt a, cpt b) {return arg(b - a);}// [-pi,pi] a to b with x axis
double angle (cpt a, cpt b, cpt c) {return arg((a-b)/(c-b));}//[-pi,pi]
//double slope(cpt a, cpt b) {return tan(arg(b - a));}// m for line segment (a,b)
double slope(cpt a, cpt b) {return (b.y-a.y)/(b.x-a.x);}



//untested
//Area of polygon and circle intersection
double areapolygoncircle(vector<Pt> p,Circle c) {
	int n=p.size();
	double r=0;
	for (int i=n-1,j=0;j<n;i=j++) {
		Pt v=abs(p[j]-p[i])/(p[j]-p[i]);
		Pt a=(p[i]-c.c)*v,b=(p[j]-c.c)*v;
		double d=norm(c.r)-norm(a.y);
		if (deq(a.y,0)) continue;
		if (d<0) d=0;//r+=norm(c.r)*(arg(b)-arg(a));
		//else {
			d=sqrt(d);
			r+=norm(c.r)*(atan2(b.y,min(b.x,-d))-atan2(a.y,min(a.x,-d))
					+atan2(b.y,max(b.x,d))-atan2(a.y,max(a.x,d)))
				+a.y*(max(a.x,-d)-min(b.x,d));
		//}
	}
	return r/2;
}


namespace AIZU_CGL_7_H {
	void solve() {
		int n,r;
		cin >> n >> r;
		vector<Pt> p(n);
		for (Pt &a:p) cin >> a;
		cout << fixed << setprecision(10) << areapolygoncircle(p,{0,r}) << endl;
	}
}

int main() {
	
	//Test::solve();
	//UVA_920::solve();
	//UVA_10263::solve();
	//UVA_10927::solve(); // Use EPS=1e-10
	//UVA_378::solve();
	//UVA_191::solve();
	//AIZU_CGL_3_C::solve();
	//UVA_634::solve();
	//UVA_453::solve(); // Use EPS=1e-4
	AIZU_CGL_7_H::solve();
}

Compiler output:
a.cc:59:39: error: 'Circle' has not been declared
   59 | double areapolygoncircle(vector<Pt> p,Circle c) {
      |                                       ^~~~~~
a.cc: In function 'double areapolygoncircle(std::vector<Pt>, int)':
a.cc:64:30: error: request for member 'c' in 'c', which is of non-class type 'int'
   64 |                 Pt a=(p[i]-c.c)*v,b=(p[j]-c.c)*v;
      |                              ^
a.cc:65:33: error: request for member 'r' in 'c', which is of non-class type 'int'
   65 |                 double d=norm(c.r)-norm(a.y);
      |                                 ^
a.cc:70:35: error: request for member 'r' in 'c', which is of non-class type 'int'
   70 |                         r+=norm(c.r)*(atan2(b.y,min(b.x,-d))-atan2(a.y,min(a.x,-d))
      |                                   ^
a.cc:70:45: error: 'b' was not declared in this scope
   70 |                         r+=norm(c.r)*(atan2(b.y,min(b.x,-d))-atan2(a.y,min(a.x,-d))
      |                                             ^
a.cc: In function 'void AIZU_CGL_7_H::solve()':
a.cc:85:71: error: cannot convert '<brace-enclosed initializer list>' to 'int'
   85 |                 cout << fixed << setprecision(10) << areapolygoncircle(p,{0,r}) << endl;
      |                                                      ~~~~~~~~~~~~~~~~~^~~~~~~~~
      |                                                                       |
      |                                                                       <brace-enclosed initializer list>
a.cc:59:46: note:   initializing argument 2 of 'double areapolygoncircle(std::vector<Pt>, int)'
   59 | double areapolygoncircle(vector<Pt> p,Circle c) {
      |                                       ~~~~~~~^