/**
* Author: chilli, Takanori MAEHARA
* Date: 2019-10-31
* License: CC0
* Source: https://github.com/spaghetti-source/algorithm/blob/master/geometry/_geom.cc#L744
* Description: Returns the area of the intersection of a circle with a
* ccw polygon.
* Time: O(n)
* Status: Tested on GNYR 2019 Gerrymandering, stress-tested
*/#pragma once
#include"src/geometry/Point.h"typedefPoint<double>P;#define arg(p, q) atan2(p.cross(q), p.dot(q))
doublecirclePoly(Pc,doubler,vector<P>ps){autotri=[&](Pp,Pq){autor2=r*r/2;Pd=q-p;autoa=d.dot(p)/d.dist2(),b=(p.dist2()-r*r)/d.dist2();autodet=a*a-b;if(det<=0)returnarg(p,q)*r2;autos=max(0.,-a-sqrt(det)),t=min(1.,-a+sqrt(det));if(t<0||1<=s)returnarg(p,q)*r2;Pu=p+d*s,v=q+d*(t-1);returnarg(p,u)*r2+u.cross(v)/2+arg(v,q)*r2;};autosum=0.0;rep(i,0,sz(ps))sum+=tri(ps[i]-c,ps[(i+1)%sz(ps)]-c);returnsum;}
Traceback(mostrecentcalllast):File"/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/onlinejudge_verify/documentation/build.py",line71,in_render_source_code_statbundled_code=language.bundle(stat.path,basedir=basedir,options={'include_paths':[basedir]}).decode()~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/onlinejudge_verify/languages/cplusplus.py",line187,inbundlebundler.update(path)~~~~~~~~~~~~~~^^^^^^File"/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py",line312,inupdateraiseBundleErrorAt(path,i+1,"#pragma once found in a non-first line")onlinejudge_verify.languages.cplusplus_bundle.BundleErrorAt:src/geometry/CirclePolygonIntersection.h:line11:#pragmaoncefoundinanon-firstline