Source
stringclasses
1 value
Date
int64
2.01k
2.02k
Text
stringlengths
22
783k
Token_count
int64
20
394k
Project_CodeNet
2,017
#include<bits/stdc++.h> using namespace std; typedef complex<double> P; typedef complex<double> V; typedef vector<P> vecP; typedef pair<P,P> L; typedef pair<P,P> S; typedef pair<P,double> C; const double eps=1e-8; const double PI=acos(-1); const double PI2=PI*2.0; namespace std{ bool operator < (const P &a,const P &...
3,101
Project_CodeNet
2,019
#include <bits/stdc++.h> #include <complex> #define rep(i, n) for (int i = 0; i < (n); i++) #define loop(i, x, n) for (int i = (x); i < (n); i++) #define all(v) (v).begin(), (v).end() #define EQ(a, b) (abs((a) - (b)) < EPS) #define int long long #define INF 1e9 #define MOD 1e9 + 7 using namespace std; template<typenam...
931
Project_CodeNet
2,018
#include <bits/stdc++.h> using ld = long double; using point = std::complex<ld>; using polygon = std::vector<point>; constexpr ld eps = 1e-10; constexpr ld pi = std::acos(-1.0); bool comp(point a, point b) { return std::real(a) < std::real(b) || (std::real(a) <= std::real(b) && std::imag(a) < std::imag(b)); } s...
1,317
Project_CodeNet
2,016
#include<iostream> #include<cmath> #include<cstdio> #define eps (1e-11) #define equals(a,b) (fabs((a)-(b))<eps) using namespace std; class Point{ public: double x,y; Point(double x=0,double y=0):x(x),y(y){} Point operator+(Point p){return Point(x+p.x,y+p.y);} Point operator-(Point p){return Point(x-p.x,y-p.y)...
943
Project_CodeNet
2,014
#include <bits/stdc++.h> using namespace std; #define dump(n) cout<<"# "<<#n<<'='<<(n)<<endl #define repi(i,a,b) for(int i=int(a);i<int(b);i++) #define peri(i,a,b) for(int i=int(b);i-->int(a);) #define rep(i,n) repi(i,0,n) #define per(i,n) peri(i,0,n) #define all(c) begin(c),end(c) #define mp make_pair #define mt make...
1,232
Project_CodeNet
2,018
#define loop(i, s, e) for(ll i = s;i < e;i++) #include <iostream> #include <iomanip> #include <set> #include <vector> #include <queue> #include <stack> #include <utility> #include <algorithm> #include <map> #include <cmath> using namespace std; typedef long long signed ll; template<typename T> class Vector2D { publ...
1,172
Project_CodeNet
2,020
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repr(i, n) for (int i = (int)(n); i >= 0; i--) #define REP(i, m, n) for (int i = (int)(m); i <= (int)(n); i++) #define REPR(i, m, n) for (int i = (int)(m); i >= (int)(n); i--) #define all(v) v.begin(), v.end() tem...
1,246
Project_CodeNet
2,018
#include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<vector> #include<set> #include<queue> #include<cstdlib> #include<algorithm> using namespace std; #define pb push_back #define mp make_pair #define SZ(x) (int)(x).size() typedef long long LL; typedef pair<int, int> pii; typedef pair<double,...
1,719
Project_CodeNet
2,015
#include <iostream> #include <iomanip> #include <cassert> #include <cmath> using namespace std; const double EPS = 1e-7; struct Point { double x, y; Point() {} Point(double x, double y) : x(x), y(y) {} Point operator+(const Point& p) const { return Point(x + p.x, y + p.y); } Point operator-(const...
1,020
Project_CodeNet
2,020
#include <bits/stdc++.h> using namespace std; using ll = long long; using Real = double; constexpr Real EPS = 1e-10; constexpr Real INF = 1e18; const Real PI = acos(-1); using P = complex<Real>; int sgn(const Real a) { return (a < -EPS ? -1 : (a > EPS ? +1 : 0)); } inline bool EQ(Real a, Real b) { return (abs...
1,610
Project_CodeNet
2,019
//距離を計算する用のメソッド置き場 #include<bits/stdc++.h> //#include"geometry.h" using namespace std; const double EPS = 1e-9; // 許容誤差。問題によって変える typedef complex<double> P; // Point #define X real() #define Y imag() double norm(P &p1, P &p2) { return (p1.X - p2.X) * (p1.X - p2.X) + (p1.Y - p2.Y) * (p1.Y - p2.Y); } namespace std ...
1,571
Project_CodeNet
2,019
#include <iostream> #include<cstdio> #include<cmath> #include<cstring> #include<algorithm> #include<vector> using namespace std; #define db double const db eps = 1e-8; struct Point{ db x, y; Point(db x=0, db y=0): x(x), y(y) {} //必须有初始化 bool operator < (const Point &p){ return x < p.x || (x == p...
1,617
Project_CodeNet
2,018
#include <bits/stdc++.h> using namespace std; #ifdef DEBUG_MODE #define DBG(n) n; #else #define DBG(n) ; #endif #define REP(i,n) for(ll (i) = (0);(i) < (n);++i) #define rep(i,s,g) for(ll (i) = (s);(i) < (g);++i) #define rrep(i,s,g) for(ll (i) = (s);i >= (g);--(i)) #define PB push_back #define MP make_pair #define FI ...
2,657
Project_CodeNet
2,013
#include <vector> #include <complex> #include <cstdio> #include <cassert> #include <cmath> using namespace std; #define REP(i,n) for(int i=0;i<(int)n;++i) #define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i) #define ALL(c) (c).begin(), (c).end() const double EPS = 1e-8; const double INF = 1e12; t...
1,099
Project_CodeNet
2,016
#include <bits/stdc++.h> using namespace std; /*******************??????********************/ const double EPS = 1e-8; const double INF = 1e12; typedef complex<double> P; namespace std { bool operator < (const P& a, const P& b) { return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b); } } double cross(co...
1,334
Project_CodeNet
2,020
#include <bits/stdc++.h> #define rep(i, n) for(int i = 0; i < (n); ++i) using namespace std; const double EPS = 1e-10; bool eq(double a, double b) {return fabs(a - b) < EPS;} struct Point { double x, y; Point(double x = 0.0, double y = 0.0) : x(x), y(y) {} Point operator + (Point &p); Point operator -...
1,675
Project_CodeNet
2,017
/* Geometry Template double !!! TODO: test everything!!! */ #include <bits/stdc++.h> using namespace std; const double INF = 1e17; const double EPS = 1e-9; const double PI = 2.0 * asin(1); inline bool is_in(double a, double b, double x) { if (a > b) { swap(a, b); } return (a - EPS <= x && x <= b + EPS); } ...
1,161
Project_CodeNet
2,019
#include<bits/stdc++.h> using namespace std; const double eps=1e-9; struct dot{ double x,y; double len(){return sqrt(x*x+y*y);} dot(double a=0.0,double b=0.0){x=a,y=b;} dot operator +(const dot&b)const {return dot(x+b.x,y+b.y);} dot operator -(const dot&b)const {return dot(x-b.x,y-b.y);} dot operator *(const doub...
1,310
Project_CodeNet
2,020
#include "bits/stdc++.h" #pragma GCC optimize("Ofast") // Begin Header {{{ using namespace std; #ifndef DEBUG #define dump(...) #endif #define all(x) x.begin(), x.end() #define rep(i, b, e) for (intmax_t i = (b), i##_limit = (e); i < i##_limit; ++i) #define reps(i, b, e) for (intmax_t i = (b), i##_limit = (e); i <= ...
3,333
Project_CodeNet
2,020
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < (int)n; i++) const double eps = 1e-10; struct Point { double x, y; Point(double x = 0.0, double y = 0.0) : x(x), y(y) {} double norm() {return sqrt(x*x + y*y);} }; Point operator + (const Point &p, const Point &q) {return Point...
1,649
Project_CodeNet
2,017
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <iostream> #include <cstdio> #include <math.h> #include <algorithm> const double EPS = 1e-9; using namespace std; class vector { public: double x, y; vector(double a, double b) { x = a; y = b; }; vector operator * (const vector &v)const { ret...
1,322
Project_CodeNet
2,017
#include <bits/stdc++.h> using namespace std; #define EPS (1e-10) #define equals(a,b) (fabs((a)-(b))<EPS) static const int COUNTER_CLOCKWISE=1; static const int CLOCKWISE=-1; static const int ONLINE_BACK=2; static const int ONLINE_FRONT=-2; static const int ON_SEGMENT=0; class Point { public: double x,y; Po...
840
Project_CodeNet
2,017
//{{{ #include <bits/stdc++.h> using namespace std; //types typedef long long ll; typedef pair<int,int> pii; //input bool SR(int &_x){return scanf("%d",&_x)==1;}bool SR(ll &_x){return scanf("%lld",&_x)==1;} bool SR(double &_x){return scanf("%lf",&_x)==1;}bool SR(char *_s){return scanf("%s",_s)==1;} bool RI(){return tru...
1,687
Project_CodeNet
2,020
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define rep(i, n) for(int i=0; i<n; ++i) using namespace std; const double EPS = 1e-10; double add(double a, double b) { if(abs(a+b) < EPS*(abs(a)+abs(b))) return 0; return a+b; } struct Vector { double x, y; Vector() {} Vector(double x, double y):x...
1,271
Project_CodeNet
2,015
#include<iostream> #include<map> #include<climits> #include<ctime> #include<cstring> #include<numeric> #include<algorithm> #include<array> #include<cmath> #include<vector> #define ALL(v) (v).begin(),(v).end() #define REP(i,p,n) for(int i=p;i<(int)(n);++i) #define rep(i,n) REP(i,0,n) #define dump(a) (cerr << #a << "="...
1,693
Project_CodeNet
2,015
#include<iostream> #include<map> #include<vector> #include<algorithm> #include<cmath> #include<climits> #include<ctime> #include<cstring> #include<stack> #include<queue> #include<sstream> #include<string> #include<set> #include<array> #define ALL(v) (v).begin(),(v).end() #define REP(i,p,n) for(int i=p;i<(int)(n);++i) ...
1,508
Project_CodeNet
2,018
#include<iostream> #include<complex> #include<vector> #include<iomanip> using namespace std; typedef complex<double> P; #define EPS 1e-9 #define shosu(x) fixed<<setprecision(x) struct L : public vector<P> { L(const P &a, const P &b) { push_back(a); push_back(b); } L(){;} }; struct C{ P c;double r; C(c...
1,177
Project_CodeNet
2,017
#include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> using flt = double; const flt eps = 1e-12, inf = 1e18, PI = acos(-1.0); template<typename T> inline T sqr(T x) {return x * x;} inline flt cmp(flt a, flt b, flt e = eps) { return fabs(a - b) >= e + fabs(a) * e ? a - b : 0; }...
1,251
Project_CodeNet
2,014
#include <stdio.h> #include <cctype> #include <limits.h> #include <math.h> #include <complex> #include <bitset> #include <vector> #include <map> #include <set> #include <stack> #include <queue> #include <cstring> #include <string> #include <sstream> #include <algorithm> #include <iomanip> #include <iostream> #define V...
1,127
Project_CodeNet
2,020
#include <bits/stdc++.h> using namespace std; using ll = long long; template<class T> using vec = vector<T>; template<class T> using vvec = vector<vec<T>>; using R = double; using P = complex<R>; #define x real() #define y imag() const R eps = 1e-9,PI = acos(-1); bool equal(R a,R b){return abs(b-a)<eps;} bool equal0(R...
1,134
Project_CodeNet
2,018
#include <bits/stdc++.h> using namespace std; constexpr double EPS = 1e-14; struct vec2 { double x, y; vec2 operator+(const vec2 rhs) { return {x + rhs.x, y + rhs.y}; } vec2 operator-(const vec2 rhs) { return {x - rhs.x, y - rhs.y}; } vec2 operator*(const double k) { ret...
1,535
Project_CodeNet
2,018
#include<cstdio> #include<vector> #include<algorithm> #include<utility> #include<numeric> #include<iostream> #include<array> #include<string> #include<sstream> #include<stack> #include<queue> #include<list> #include<functional> #define _USE_MATH_DEFINES #include<math.h> #include<map> #define INF 200000000 using name...
1,117
Project_CodeNet
2,020
#include <bits/stdc++.h> using namespace std; using CP = complex<long double>; #define X real() #define Y imag() const long double PI = acos(-1.0L); const long double EPS = 1e-10; // conj(x) : complex conjugate,(0,1)->(0,-1) // abs(x) : dist between(0,0) and x // norm(x) : abs(x) * abs(x) // arg(x) : argment // dot(a...
1,177
Project_CodeNet
2,020
#include<bits/stdc++.h> using namespace std; const double eps = 1e-10; struct Node { double x, y; Node(double xx = 0, double yy = 0){ x = xx; y = yy; } Node operator + (Node b){ return Node(x+b.x, y+b.y); } Node operator - (Node b){ return Node(x-b.x, y-b.y); } N...
1,448
Project_CodeNet
2,019
#include <iostream> #include <string> #include <algorithm> #include <functional> #include <vector> #include <utility> #include <cstring> #include <iomanip> #include <numeric> #include <cmath> #include <cassert> #include <complex> using namespace std; using ll = long long; const int INF = 1<<30; const int MOD = 1e9 + 7;...
1,290
Project_CodeNet
2,015
#include <bits/stdc++.h> using namespace std; #define EPS 1e-10 struct Point{ double x,y; Point(){} Point(double x,double y) : x(x),y(y) {} Point operator + (const Point &p)const{ return Point(x+p.x,y+p.y); } Point operator - (const Point &p)const{ return Point(x-p.x,y-p.y); } Point operato...
717
Project_CodeNet
2,018
#include <iostream> #include <math.h> #include <stdio.h> #include <vector> using namespace std; // 2次元ベクトルクラス class Vector { public: double x, y; // コンストラクタ Vector() { x = 0.0; y = 0.0; } // コンストラクタ(引数あり) Vector(double nx, double ny) { x = nx; y = ny; ...
2,380
Project_CodeNet
2,019
/*<<head>> {{{*/ #include <bits/stdc++.h> #include <algorithm> #include <iostream> #include <cstring> #include <vector> #include <cstdio> #include <string> #include <cmath> #include <queue> #include <stack> #include <set> #include <map> using namespace std; typedef double db; typedef long long ll; typedef vector<int> v...
3,648
Project_CodeNet
2,018
#include <bits/stdc++.h> #define REP(i,n) for (long long i=0;i<(n);i++) #define FOR(i,a,b) for (long long i=(a);i<(b);i++) #define RREP(i,n) for(long long i=n;i>=0;i--) #define RFOR(i,a,b) for(long long i=(a);i>(b);i--) #define dump1d_arr(array) REP(i,array.size()) cerr << #array << "[" << (i) << "] ==> " << (array[i])...
2,044
Project_CodeNet
2,019
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pu push #define pb push_back #define mp make_pair #define eps 1e-9 #define Vector Point #define INF 2000000000 #define DOUBLE_INF 1e50 #define sq(x) ((x)*(x)) #define fi first #define sec second #define all(x) (x).begin(),(x).end() #define EQ(a...
1,236
Project_CodeNet
2,019
#include <stdio.h> #include <iostream> #include <cstdlib> #include <cmath> #include <cctype> #include <string> #include <cstring> #include <algorithm> #include <stack> #include <queue> #include <set> #include <map> #include <ctime> #include <vector> #include <fstream> #include <list> #include <iomanip> #include <numeri...
1,524
Project_CodeNet
2,019
#include <bits/stdc++.h> using namespace std; #define EPS 1e-10 class point { public: double x, y; point() {} point( double x_, double y_ ) : x(x_), y(y_) {} point operator -( point p ) { return point( x - p.x, y - p.y ); } point operator +( point p ) { return point( x + p.x, y + p.y ); } point operator *( int ...
707
Project_CodeNet
2,018
#include <bits/stdc++.h> using namespace std; typedef complex<double> Point; typedef pair<Point, Point> Line; const double EPS = 1e-10; // 内積 |a||b|cosθ double dot(Point a, Point b){ // return a.real() * b.real() + a.imag() * b.imag(); return (conj(a) * b).real(); } // 外積、符号付面積の2倍 |a||b|sinθ double cross(Point a, Po...
789
Project_CodeNet
2,019
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for (int (i)=(0);(i)<(int)(n);++(i)) using ll = long long; //using P = pair<int, int>; using namespace std; const double eps = 1e-10; #define equals(a, b) (fabs((a)-(b)) < eps) // 点 struct Point { double x, y; Point(double x=0, double y=0): x(x), ...
2,884
Project_CodeNet
2,016
#include <bits/stdc++.h> using namespace std; #define int long long // <-----!!!!!!!!!!!!!!!!!!! #define rep(i,n) for (int i=0;i<(n);i++) #define rep2(i,a,b) for (int i=(a);i<(b);i++) #define rrep(i,n) for (int i=(n)-1;i>=0;i--) #define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--) #define all(a) (a).begin(),(a).end() ...
882
Project_CodeNet
2,019
#include<bits/stdc++.h> #define INTMAX 2147483647LL #define PII pair<int,int> #define MK make_pair #define re register #define Eps (1e-10) #define Equal(a,b) (fabs((a)-(b))<Eps) using namespace std; typedef long long ll; typedef double db; const double Pi=acos(-1.0); const int Inf=0x3f3f3f3f; static const int COUNTER_...
1,437
Project_CodeNet
2,020
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; double x,y,xx,yy,xxx,yyy,xxxx,yyyy; int q; int main(){ cin>>q; while(q--){ cin>>x>>y>>xx>>yy>>xxx>>yyy>>xxxx>>yyyy; int pd1=0,pd2=0,pd3=0,pd4=0,pd5=0; xx-=x,yy-=y,xxx-=x,yyy-=y,xxxx-=x,yyyy...
1,222
Project_CodeNet
2,015
#include <iostream> #include <cstdio> #include <cmath> #include <algorithm> using namespace std; #define equals(a, b) (fabs((a)-(b)) < EPS) const double EPS = (1e-10); class Point { public: double x, y; Point(double x = 0, double y = 0): x(x), y(y) {} Point operator + (Point p) { return Point(x+...
963
Project_CodeNet
2,015
#include<bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<pair<int, int> > vii; #define rrep(i, m, n) for(int (i)=(m); (i)<(n); (i)++) #define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++) #define rep(i, n) for(int (i)=0; (i)<(n); ...
1,550
Project_CodeNet
2,018
// // 線分と線分の距離 // // verified: // AOJ Course CGL_2_D Segments/Lines - Distance // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_D&lang=jp // #include <iostream> #include <vector> #include <cmath> #include <iomanip> using namespace std; /* Point */ using DD = double; const DD INF = 1LL<<60; ...
1,618
Project_CodeNet
2,020
#include <iostream> #include <algorithm> #include <iterator> #include <iomanip> #include <cmath> #include <vector> #include <numeric> #include <cstdio> #include <bitset> #include <map> #include <string> #include <valarray> #include <queue> #include <utility> #include <functional> #include <list> using namespace std; ...
2,353
Project_CodeNet
2,019
#include <iostream> #include <algorithm> #include <iomanip> #include <map> #include <set> #include <queue> #include <stack> #include <numeric> #include <bitset> #include <cmath> static const int MOD = 1000000007; using ll = long long; using u32 = uint32_t; using namespace std; template<class T> constexpr T INF = ::nu...
1,072
Project_CodeNet
2,019
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <cmath> #include <cstring> #include <utility> #include <numeric> #include <complex> #include <iomanip> using namespace std; // common #define X real() #define Y imag() using Vector2 = complex<double>; using Line = pair<Vector2, Vec...
840
Project_CodeNet
2,014
#include <iostream> #include <vector> #include <complex> #include <cstdlib> #include <iomanip> using namespace std; const double eps = 1e-10; typedef complex<double> Point; inline double cross(const Point& a, const Point& b){ return imag(conj(a) * b); } inline double dot(const Point& a, const Point& b){ ret...
648
Project_CodeNet
2,016
#include <bits/stdc++.h> using namespace std; #define db double const db eps = 1e-6; int sgn(db a, db b = 0) { a -= b; return (a > eps) - (a < -eps); } struct poi { db x, y; void r() { cin >> x; cin >> y; } void w() { cout << x << ' ' << y << '\n'; } poi operator -(poi p) { return {x - p.x, y - p.y}; } poi ...
782
Project_CodeNet
2,020
#include <iostream> #include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <cstring> #include <ctime> #include <iomanip> #include <map> #include <queue> #include <set> #include <tuple> using namespace std; typedef long long ll; #define _ << " " << #define all(X) (X).begi...
1,555
Project_CodeNet
2,014
#include <vector> #include <iomanip> #include <algorithm> #include <limits> #include <iostream> #include <cmath> using namespace std; typedef long long ll; typedef unsigned long long ull; namespace libcomp { namespace geometry { static const double EPS = 1e-9; inline double abs(double x){ return std::abs(x); } inline b...
2,075
Project_CodeNet
2,019
#include <algorithm> #include <complex> #include <vector> using namespace std; const double eps = 1e-10; #define EQ(a, b) (abs((a) - (b)) < eps) using P = complex<double>; // position struct L : vector<P> { L(const P &a = P(), const P &b = P()) { emplace_back(a); emplace_back(b); } }; ostream &oper...
729
Project_CodeNet
2,018
#include <algorithm> #include <cmath> #include <complex> #include <iomanip> #include <iostream> #include <vector> using namespace std; const double EPS = 1e-8, PI = acos(-1); inline bool eq(double a, double b) { return fabs(b - a) < EPS; } using Point = complex<double>; istream &operator>>(istream &is, Point &p) {...
4,617
Project_CodeNet
2,014
#include <iostream> #include <complex> #include <sstream> #include <string> #include <algorithm> #include <deque> #include <list> #include <map> #include <numeric> #include <queue> #include <vector> #include <set> #include <limits> #include <cstdio> #include <cctype> #include <cmath> #include <cstring> #include <cstdli...
977
Project_CodeNet
2,019
#include <bits/stdc++.h> using namespace std; namespace LCY{ #define double long double const double EPS=1e-10; inline int dcmp(double x){if(fabs(x)<EPS)return 0;return (x<0)?-1:1;} struct Point{double x,y;Point(double _x=0,double _y=0){x=_x;y=_y;}}; struct Vector{double x,y;Vector(double _x=0,double _y=0){x=_x;y=...
1,221
Project_CodeNet
2,019
#include<bits/stdc++.h> #define ll long long #define rep(i,n) for(ll i=0;i<n;i++) using namespace std; const double pi = acos(-1); const double eps = 1e-10; static const int COUNTER_CLOCKWISE = 1; static const int CLOCKWISE = -1; static const int ONLINE_BACK = 2; static const int ONLINE_FRONT = -2; static const int ON...
1,314
Project_CodeNet
2,019
#include <iostream> #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> using namespace std; int num; double x,yy1,yy2,yy3,yy4; const double eps = 1e-8; const double inf = 1e20; const double pi = acos(-1.0); int sgn(double x){ if(fabs(x)<eps){ return 0; } if(x<0){ retu...
873
Project_CodeNet
2,020
#include <iostream> #include <iomanip> #include <algorithm> #include <assert.h> #include <complex> #include <utility> #include <vector> #include <string> #include <stack> #include <queue> #include <tuple> #include <cmath> #include <bitset> #include <cctype> #include <set> #include <map> #include <unordered_map> #includ...
1,607
Project_CodeNet
2,019
#include<bits/stdc++.h> using namespace std; #define eps = (1e-10); //点 struct Point{ double x,y; Point(double _x=0,double _y=0):x(_x),y(_y){} Point operator + (Point p){return Point(x+p.x,y+p.y);} Point operator - (Point p){return Point(x-p.x,y-p.y);} Point operator * (double a){return Point(a*x,a...
760
Project_CodeNet
2,020
#include<iostream> #include<iomanip> #include<cstdio> #include<cmath> #define EPS (1e-10) #define equals(a, b) (fabs((a) - (b)) < EPS) using namespace std; class Point { public: double x, y; Point(double x = 0, double y = 0): x(x), y(y) {} Point operator + (Point p) {return Point(x + p.x, y ...
1,309
Project_CodeNet
2,019
using namespace std; #include<iostream> #include<algorithm> #include<cmath> #include<iomanip> const double EPS=1e-10; bool eq(double a,double b){return abs(a-b)<EPS;} struct Point{ double x,y; Point(double x_=0,double y_=0):x(x_),y(y_){} Point operator-()const{return Point(-x,-y);} Point operator+(const Point&p)con...
2,255
Project_CodeNet
2,020
#include <bits/stdc++.h> using namespace std; #define mkp make_pair #define rep(i,n) for(int i=0;i<(n);++i) typedef long long ll; const ll MOD=1e9+7; const double EPS=1e-9; const double PI=acos(-1.0); //const long double PI=acos(-1.0L); struct Point{ double x,y; Point(){} Point(double x,double y):x(x),y(y...
1,032
Project_CodeNet
2,020
#include<bits/stdc++.h> using namespace std; typedef complex<double> Point; const double epx=1e-10; Point read() { int x,y; cin>>x>>y; return Point(x,y); } int ccw(Point a,Point b,Point c) { b-=a;c-=a;a=c*conj(b); if(a.imag()>epx) return 1; if(a.imag()<-epx) return -1; if(a.real()<-epx) ...
429
Project_CodeNet
2,020
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a, i##end = b; i <= i##end; ++i) #define per(i, a, b) for (int i = a, i##end = b; i >= i##end; --i) #define rep0(i, a) for (int i = 0, i##end = a; i < i##end; ++i) #define per0(i, a) for (int i = (int)a-1; ~i; --i) #define max(a, b) ((a) > (b) ? (a) : (b)) #de...
1,181
Project_CodeNet
2,016
#include<iostream> #include<sstream> #include<algorithm> #include<climits> #include<cmath> #include<cstdio> #include<cstdlib> #include<ctime> #include<cfloat> #include<functional> #include<map> #include<string> #include<cstring> #include<vector> #include<queue> #include<stack> #include<deque> #include<set> #include<bit...
1,394
Project_CodeNet
2,016
#include <iostream> #include <iomanip> #include <cmath> #include <array> #include <algorithm> using Number = double; const Number EPS = 1e-10; const Number INF = 1e10; const Number PI = acos(-1.0); inline int sign(Number x) { return (x < -EPS) ? -1 : (x > EPS) ? +1 : 0; } inline bool equal(Number a, Number b) { retu...
2,308
Project_CodeNet
2,019
#include <cstdio> #include <utility> #include <cctype> #include <algorithm> #include <complex> using namespace std; #ifdef __linux #define _U(s) s##_unlocked #else #define _U(s) _##s##_nolock #define _CRT_DISABLE_PERFCRIT_LOCKS #endif #define gcu _U(getchar) #define pcu _U(putchar) #define _DEF(r, n, ...) inline r n(_...
1,255
Project_CodeNet
2,018
// Code by ajcxsu // Geometry template #include<bits/stdc++.h> #define EPS (1e-9) using namespace std; struct Point { double x,y; Point(double x=0,double y=0):x(x), y(y) {} Point operator +(Point p) { return Point(x+p.x,y+p.y); } Point operator -(Point p) { return Point(x-p.x,y-p.y); } // 加减 Poin...
1,179
Project_CodeNet
2,017
#include <iostream> #include <iomanip> #include <string> #include <vector> #include <algorithm> #include <numeric> #include <map> #include <set> #include <cstdio> #include <cstring> #include <cmath> #include <bitset> #include <climits> #define REP(i,n) for (int i=0;i<(n);i++) #define FOR(i,a,b) for (int i=(a);i<(b);i++...
1,596
Project_CodeNet
2,019
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for(int i = a; i < (b); ++i) #define trav(a, x) for(auto& a : x) #define all(x) x.begin(), x.end() #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; template<class T> struct Point { typedef Point ...
975
Project_CodeNet
2,017
#include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <iostream> #include <string> #include <algorithm> #include <vector> #include <queue> #include <stack> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <complex> #include <functional> #include <ca...
1,689
Project_CodeNet
2,016
#include<iostream> #include<cmath> #include<iomanip> #include<algorithm> using namespace std; struct Point { long double px, py; }; struct Segment { Point p1, p2; }; Point Minus(Point a, Point b) { Point G; G.px = a.px - b.px; G.py = a.py - b.py; return G; } long double Abs(Point a) { return sqrt(a.px*a.px + a.py*a.py)...
718
Project_CodeNet
2,019
// Written By NewbieChd #include <iostream> #include <iomanip> #include <cmath> // #define double long double using namespace std; const int maxN = 100003; const double eps = 1e-8, inf = 1e18; inline double absolute(double x) { return x >= 0 ? x : -x; } inline double square(double x) { return x * x; } struct Vector {...
1,004
Project_CodeNet
2,020
#include <bits/stdc++.h> using namespace std; #define EPS (1e-10) #define equals(a,b) (fabs((a)-(b))<EPS) class Point{ public: double x,y; Point(double x=0,double y=0):x(x),y(y){} Point operator+(const Point &p){ return Point(x+p.x,y+p.y); } Point operator-(const Point &p){ ret...
1,035
Project_CodeNet
2,017
#include "bits/stdc++.h" #include <sys/timeb.h> #include <fstream> using namespace std; #define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define rep(i,n) repl(i,0,n) #define replrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--) #define reprev(i,n) replrev(i,0,n) #define repi(itr,ds) for(auto itr=ds.begin();itr!=...
2,402
Project_CodeNet
2,019
#include <iostream> #include <vector> #include <string> #include <cmath> #include <set> #include <algorithm> #include <array> #include <complex> #include <string> #include <utility> #include <map> #include <queue> #include <list> #include <functional> #include <numeric> #include <stack> #include <tuple> using namespac...
1,273
Project_CodeNet
2,016
#include<iostream> #include<algorithm> #include<cmath> #include<iomanip> using namespace std; static const int COUNTER_CLOCKWISE = 1; //??????????????¨?????? static const int CLOCKWISE = -1; static const int ON_SEGMENT = 0; static const int ONLINE_FRONT = 2; static const int ONLINE_BACK = -2; const double EPS = 1e-10;...
1,240
Project_CodeNet
2,020
#include <algorithm> #include <bitset> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <tuple> #include <vector> using namespace std; #define rep(i, n) for (int64_t i = 0; i < (n); i++) #define irep(i, n) for (int6...
1,382
Project_CodeNet
2,019
#include <bits/stdc++.h> using namespace std; namespace Computational_Geometry { const long double eps=1e-10; struct Vector2 { long double x,y; Vector2(long double X=0.0,long double Y=0.0):x(X),y(Y) {} Vector2 *read() {scanf("%Lf%Lf",&x,&y); return this;} void print() {printf("%.10Lf %.10Lf",x,y); return;} ...
1,431
Project_CodeNet
2,020
#include <bits/stdc++.h> using namespace std; #define EPS (1e-10) #define equals(a, b) (fabs((a) - (b)) < EPS) class Point { public: double x, y; Point(double x = 0, double y = 0): x(x), y(y) {} Point operator + (Point p) { return Point(x + p.x, y + p.y); } Point operator - (Point p) { retur...
1,516
Project_CodeNet
2,014
#include <cstdio> #include <iostream> #include <complex> #include <vector> #include <cmath> #include <cassert> #define rep(i,n) for(int i=0;i<n;i++) #define fs first #define sc second #define pb push_back using namespace std; typedef double D; typedef complex<D> P; typedef pair<P,P> L; //fs->sc typedef vector<P> Pol; ...
1,720
Project_CodeNet
2,020
#include <iostream> #include <vector> #include <stack> #include <queue> #include <set> #include <cmath> #include <algorithm> #include <iomanip> using namespace std; #define EPS (1e-10) #define equals(a, b) (fabs(a - b) < EPS) class Point{ public: double x, y; Point(double x = 0, double y = 0) : x(x), y(y) {} P...
1,560
Project_CodeNet
2,016
#include <iostream> #include <cstdio> #include <cmath> #include <algorithm> using namespace std; static const double eps = 1e-10; static const int COUNTER_CLOCKWISE = 1; static const int CLOCKWISE = -1; static const int ONLINE_BACK = 2; static const int ONLINE_FRONT = -2; static const int ON_SEGMENT = 0; bool equals(...
1,293
Project_CodeNet
2,014
#include <map> #include <set> #include <list> #include <cmath> #include <queue> #include <stack> #include <cstdio> #include <string> #include <vector> #include <complex> #include <cstdlib> #include <cstring> #include <numeric> #include <sstream> #include <iostream> #include <algorithm> #include <functional> #define mp...
3,761
Project_CodeNet
2,017
// #include {{{ #include <iostream> #include <cassert> #include <cstring> #include <cstdlib> #include <cstdio> #include <cctype> #include <cmath> #include <ctime> #include <queue> #include <set> #include <map> #include <stack> #include <string> #include <bitset> #include <vector> #include <complex> #include <algorithm>...
928
Project_CodeNet
2,019
#include<iostream> #include<iomanip> #include<cmath> #include<vector> #include<algorithm> using namespace std; const double EPS = 1e-10; bool equals(double a, double b){ return (fabs(a) - fabs(b)) < EPS;}; static const int COUNTER_CLOCKWISE = 1; static const int CLOCKWISE = -1; static const int ONLINE_BACK = 2; stat...
1,369
Project_CodeNet
2,017
#include <map> #include <set> #include <list> #include <cmath> #include <deque> #include <queue> #include <stack> #include <cstdio> #include <string> #include <vector> #include <complex> #include <cstdlib> #include <cstring> #include <iomanip> #include <numeric> #include <utility> #include <iostream> #include <algorith...
1,511
Project_CodeNet
2,020
/* 幾何 https://gist.github.com/zeptometer/3719669 複素数平面による幾何ライブラリ←もっと短くなる可能生アリ http://osrehun.hatenadiary.jp/entry/2016/12/31/145827 */ #include <bits/stdc++.h> using namespace std; using DD=double; #define EPS 1e-10 #define eq(a,b) (abs( (a) - (b) )<EPS) const DD PI=acosl(-1.0); constexpr DD INF=1LL<<62; //点 using...
4,147
Project_CodeNet
2,016
#include <iostream> #include <stdio.h> #include <vector> #include <math.h> #include <algorithm> using namespace std; #define EPS (1e-10) #define equals(a,b) (fabs((a) - (b)) < EPS) //????????????????????????????????? //??????p0,p1,p2???????????? #define COUNTER_CLOCKWISE 1 //???????????§???????¨????????????´??? #d...
2,118
Project_CodeNet
2,016
#include <vector> #include <algorithm> #include <iostream> #include <cstdio> #include <cmath> #include <climits> using namespace std; #define EPS (1e-10) #define equals(a, b) (fabs((a) - (b)) < EPS) //??? class Point { public: double x, y; Point (double x = 0, double y = 0):x(x), y(y){} Point operat...
1,499
Project_CodeNet
2,016
/* template.cpp {{{ */ #include <bits/stdc++.h> using namespace std; // #define int long long #define GET_MACRO(a, b, c, d, NAME, ...) NAME #define REP1(n) REP2(i_, n) #define REP2(i, n) REP3(i, 0, n) #define REP3(i, a, b) REP4(i, a, b, 1) #define REP4(i, a, b, s) for (long long i = (a); i < (long long)(b); i += (lon...
2,822
Project_CodeNet
2,019
#define EPS 1e-10 #define equals(a, b) (fabs((a) - (b)) < EPS) #include <cstdio> #include <cmath> #include <vector> #include <algorithm> using namespace std; // definition of turning static const int COUNTER_CLOCKWISE = 1; static const int CLOCKWISE = -1; static const int ONLINE_BACK = 2; static const int ONLINE_FRONT...
1,410
Project_CodeNet
2,019
#include <bits/stdc++.h> using namespace std; /* #ifndef ONLINE_JUDGE #include <boost/multiprecision/cpp_int.hpp> #include <boost/multiprecision/cpp_dec_float.hpp> using bll = boost::multiprecision::cpp_int; using bdouble = boost::multiprecision::cpp_dec_float_100; #endif */ #ifdef LOCAL_DEV void debug_impl() { st...
4,797
Project_CodeNet
2,017
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;(i)<(n);++(i)) using namespace std; // Description: ???????????? // Verifyed: various problem using namespace placeholders; using R=long double; const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7 inline int sgn(const R& r){return(r > EPS)-(r < -...
761