Source
stringclasses
1 value
Date
int64
2.01k
2.02k
Text
stringlengths
22
783k
Token_count
int64
20
394k
Project_CodeNet
2,020
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <utility> #include <cmath> #include <cstdio> #define rep(i,n) for(int i = 0; i < n; ++i) #define rep1(i,n) for(int i = 1; i <= n; ++i) #define F first #define S second using namespace std; template<class T>bool chmax(T &a, const T &b)...
1,328
Project_CodeNet
2,018
#include <bits/stdc++.h> //#define int long long using namespace std; using LL = long long; using P = pair<int, int>; using Tapris = tuple<int, int, int>; #define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i) #define REP(i, n) FOR(i, 0, n) #define pb(a) push_back(a) #define all(x) (x).begin(),(x).end() cons...
1,652
Project_CodeNet
2,019
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int inf = 1e9 + 7; using pii = pair<int, int>; #define rep(i, n) for (int i = 0; i < n; ++i) #define rrep(i, st, n) for (int i = st; i < n; ++i) #define chmax(a, b) a = max(a, b) #define chmin(a, b) a = min(a, b) #define eb emplace_back #define EQ...
856
Project_CodeNet
2,014
#include <cassert>// c #include <iostream>// io #include <iomanip> #include <fstream> #include <sstream> #include <vector>// container #include <map> #include <set> #include <queue> #include <bitset> #include <stack> #include <algorithm>// other #include <complex> #include <numeric> #include <functional> using namespac...
1,755
Project_CodeNet
2,019
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <vector> using namespace std; const double EPS = 1e-9; int sign(double x) { if (fabs(x) < EPS) { return 0; } else if (x > 0) { return 1; } else { return -1; } } int dcmp(double x, double y) {...
2,300
Project_CodeNet
2,017
/// // File: cgl_2_d.cpp // Author: ymiyamoto // // Created on Mon Oct 23 00:28:22 2017 // #include <cmath> #include <cstdint> #include <iomanip> #include <iostream> using namespace std; #define EPS 1e-10 #define equals(x, y) (fabs(x - y) < EPS) struct vector_t { double x; double y; vector_t(double a, double ...
1,089
Project_CodeNet
2,019
#include <iostream> #include <fstream> #include <string> #include <iomanip> #include <math.h> #include <stdbool.h> #include <algorithm> 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); } ...
1,244
Project_CodeNet
2,014
#include<iostream> #include<complex> #include<array> #include<vector> #include<cstdio> #include<cassert> using namespace std; const double EPS = 1e-10; template<class T> bool eq(const T& a, const T& b) {return abs(a - b) < EPS;} typedef complex<double> point; double cross(const point& a, const point& b) { return i...
1,313
Project_CodeNet
2,019
#include<iostream> #include<algorithm> #include<vector> #include<stack> #include<queue> #include<list> #include<string> #include<cstring> #include<cstdlib> #include<cstdio> #include<cmath> #include<ctime> using namespace std; typedef long long ll; bool debug = false; const int NIL = -1; const int INF = 1000000000; co...
1,295
Project_CodeNet
2,018
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double lf; typedef pair<int, int> pii; const int MAXN = 5; const int MOD = 1e9+7; const lf eps = 1e-9; typedef double T; struct pt { T x, y; pt operator + (pt p) { return {x+p.x, y+p.y}; } pt operator - (pt p) { return {x-p.x, y-p...
3,243
Project_CodeNet
2,015
#include <iostream> #include <iomanip> #include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <functional> #include <sstream> #include <string> #include <utility> #include <map> #include <memory> #include <set> #include <vector> #inclu...
906
Project_CodeNet
2,019
#include <bits/stdc++.h> using namespace std; using ll = long long; const int mod = 1e9 + 7; const int inf = (1 << 30) - 1; const ll infll = (1LL << 61) - 1; using Real = double; using Point = complex<Real>; const Real Pi = acos(-1), EPS = 1e-9; inline bool eq(Real a, Real b) { return fabs(a - b) < EPS; } //scalar Po...
1,916
Project_CodeNet
2,017
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define INF 1<<30 #define LINF 1LL<<60 typedef long double ld; typedef complex<ld> Point; const ld eps = 1e-9, pi = acos(-1.0); namespace std { bool operator<(const Point &lhs, const Point &rhs...
1,298
Project_CodeNet
2,020
#include<bits/stdc++.h> const double 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){ return Po...
1,254
Project_CodeNet
2,016
#include<iostream> using namespace std; #include<cstdio> #include<cmath> struct Point{ double x, y; }; Point set_p(double a, double b) { Point p; p.x = a; p.y = b; return p; } struct Vector{ double vx, vy; }; Vector set_v(const Point &p1, const Point &p2) { Vector v; v.vx = p2.x - p1.x; v.vy...
931
Project_CodeNet
2,019
#include<iostream> #include<cmath> #include<algorithm> #include<cstdio> using namespace std; 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; #define EPS (1e-10) #define equals(a,b) (fabs((a...
973
Project_CodeNet
2,020
#include<cmath> #include<iostream> #include<algorithm> #include<iomanip> #include<vector> #include<cassert> using namespace std; namespace geometry2d { //eps 浮動小数点誤差 const double EPS = 1e-10; //a > 0ならば+1, a == 0ならば0, a < 0ならば-1 を返す。 基本的にEPS込みの評価はこれで行う。 //不等式は、加減算に直してこれに適用する。 int sgn(const double a) { return...
2,956
Project_CodeNet
2,019
#include<bits/stdc++.h> #define For(i,x,y) for (register int i=(x);i<=(y);i++) #define FOR(i,x,y) for (register int i=(x);i<(y);i++) #define Dow(i,x,y) for (register int i=(x);i>=(y);i--) #define mp make_pair #define fi first #define se second #define pb push_back #define siz(x) ((int)(x).size()) #define all(x) (x).beg...
1,183
Project_CodeNet
2,019
#include <stdio.h> #include <math.h> const double eps=1e-9; double ABS(double n){return n>=0?n:-n;} double min(double a,double b){return a>b?b:a;} double max(double a,double b){return a>b?a:b;} bool same(double a,double b){return ABS(a-b)<eps;} struct point{ double x; double y; point(){} point(double a,double b){x=...
1,202
Project_CodeNet
2,020
#include <iostream> #include <iomanip> #include <cmath> using namespace std; #define 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; struct Point { double x, y; };//点 struct Segment { Poin...
1,284
Project_CodeNet
2,018
#include <iostream> #include <iomanip> #include <math.h> using namespace std; const double eps = 1e-15; bool IsEq(double d1, double d2) { if (d1 - d2 > -eps && d1 - d2 < eps){ return true; } else { return false; } } class Point2D { public: double x, y; Point2D() : x(0), y(0) {} ...
1,300
Project_CodeNet
2,020
// include //------------------------------------------ #include <bits/stdc++.h> using namespace std; // conversion //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostrings...
1,999
Project_CodeNet
2,017
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) REP(i, 0, n) #define REP(i, s, e) for(int i = (int)s; i < (int)(e); ++i) #define X real() #define Y imag() #define x(p) real(p) #define y(p) imag(p) #define curr(P, i) P[i] #define next(P, i) P[(i+1)%P.size()] #define prev(P, i) P[...
978
Project_CodeNet
2,017
#include<bits/stdc++.h> using namespace std; using Int = long long; //BEGIN CUT HERE #define EPS (1e-10) #define equals(a,b) (fabs((a)-(b)) < EPS) #define PI 3.141592653589793238 // COUNTER CLOCKWISE static const int CCW_COUNTER_CLOCKWISE = 1; static const int CCW_CLOCKWISE = -1; static const int CCW_ONLINE_BACK = 2...
5,177
Project_CodeNet
2,018
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; #define int long long typedef long long lint; typedef pair<int,int> P; const int INF=(int)1e9; const int MOD=(int)1e9+7; const double EPS=(double)1e-10; const int dx[]={-1,0,0,1}; const int dy[]={0,-1,1,0}; struct Accelerate_Cin{ Ac...
1,172
Project_CodeNet
2,017
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <iomanip> using namespace std; #define EPS (1e-10) typedef long double ld; class Point { public: ld x, y; Point(ld x, ld y) : x(x), y(y) { } Point operator +(Point p) { return Point(x + p.x, y + p.y); } Point operator -(...
926
Project_CodeNet
2,018
// CGL_2_D.cpp // #include <bits/stdc++.h> using namespace std; const double EPS = 1e-10; bool EQ(double a, double b){return fabs(a-b) < EPS;} typedef complex<double> Point; #define X real() #define Y imag() struct Segment { Point p1, p2; Segment(){}; Segment(Point p1, Point p2) : p1(p1), p2(p2) {}; }; typedef ...
768
Project_CodeNet
2,017
#include <bits/stdc++.h> using namespace std; #define EPS (1e-10) #define equals(a, b) (fabs((a) - (b)) < (EPS)) #define COUNTER_CLOCKWISE (1) #define CLOCKWISE (-1) #define ONLINE_BACK (2) #define ONLINE_FRONT (-2) #define ON_SEGMENT (0) struct Point { double x, y; Point() {} Point(double x, double y) ...
994
Project_CodeNet
2,018
#include<iostream> #include<cmath> #include<iomanip> using namespace std; const double EPS=1e-10; struct point{ double x,y; point(const point&a):x(a.x),y(a.y){} point(const double&x=0,const double&y=0):x(x),y(y){} point operator+(const point&p)const{return point(x+p.x,y+p.y);} point operator-(const point&p)const{r...
1,073
Project_CodeNet
2,014
#include <iostream> #include <math.h> #include <cmath> #include <iomanip> #include <stack> #include <queue> #include <vector> #include <algorithm> using namespace std; //------------------------------------------------------------------------------------- /*2点[(x1,y1),(x2,y2)]を入力し二点を通る直線ax+by+cの(a,b,c)を返す, */ /*x1=...
6,335
Project_CodeNet
2,020
//#define NDEBUG #include "bits/stdc++.h" #include <iostream> #include <string> #include <unordered_map> #include <unordered_set> #include <array> #include <random> #ifdef _MSC_VER #include <ppl.h> //#include <boost/multiprecision/cpp_dec_float.hpp> //#include <boost/multiprecision/cpp_int.hpp> //#include <boost/ration...
3,536
Project_CodeNet
2,017
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #include <cmath> #include <vector> #include <deque> #include <queue> using namespace std; #define rep(i,a,n) for(int i=(a);i<(n);i++) #define per(i,a,n) for(int i=(n)-1;i>=(a);i--) #define mp make_pair #define pb push_back typedef double db;...
1,631
Project_CodeNet
2,019
#include <cmath> #include <cstdlib> #include <iostream> #include <bitset> #include <deque> #include <list> #include <map> #include <set> #include <queue> #include <stack> #include <vector> #include <algorithm> #include <iterator> #include <string> #include <chrono> #include <random> #include <tuple> #include <utility> ...
1,101
Project_CodeNet
2,015
#include <bits/stdc++.h> using namespace std; typedef long long int64; typedef pair<int,int> pii; typedef vector<int> vi; typedef complex<double> point; struct line { point p, q; }; struct segment {point p, q; }; const double eps = 1e-9; double dot(point a, point b) { return real(conj(a) * b); } double cross(poin...
714
Project_CodeNet
2,016
#include "bits/stdc++.h" using namespace std; //????????? #pragma region MACRO #define putans(x) std::cerr << "answer: " ; cout << (x) << endl #define dputans(x) std::cerr << "answer: "; cout << setprecision(27) << (double)(x) << endl #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define RREP(i,a,n) for(int i=(...
4,433
Project_CodeNet
2,019
#include <cstdio> #include <cmath> #include <algorithm> #include <vector> namespace Random_Number{ unsigned int seed = 19260817; void srnd(unsigned int x){ seed = x; } unsigned int rnd(){ return seed ^= seed << 19, seed ^= seed >> 7, seed ^= seed << 1; } } using namespace Random_Number; namespace Geometry{ const...
4,000
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)...
733
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.0, double y = 0.0) : x(x), y(y) { } Point operator +(Point p) { return Point(x + p.x, y + p.y); } Point operator -(Point p) { return Point(x...
1,178
Project_CodeNet
2,019
#include<bits/stdc++.h> using namespace std; typedef double db; const db eps = 1e-15, pi = acos(-1); int sign(db x) {return x < -eps ? -1 : x > eps;} int cmp(db x, db y) {return sign(x - y);} int intersect(db l1, db r1, db l2, db r2) { if (l1 > r1) swap(l1, r1); if (l2 > r2) swap(l2, r2); return cmp(r1, l2) != -1 &...
1,530
Project_CodeNet
2,017
#include <iostream> #include <cmath> #include <iomanip> using namespace std; const double EPS = 1e-8; int dcmp(double d) { if (fabs(d) < EPS) { return 0; } return d < 0? -1 : 1; } struct Vector { double x, y; Vector(double x=0, double y=0): x(x), y(y){ } }; typedef Vector Point; do...
932
Project_CodeNet
2,019
#include<bits/stdc++.h> #define mset(a,b) memset(a,b,sizeof(a)) #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 using namespace std; typedef long long ll; const ll maxn=1e4+200; const int inf=0x3f3f3f3f; const double EPS=1e-10; //typedef pair<int,int> PA; double add(double a,double b){//考虑误差的加法运算 if(abs(a+b)<EPS*...
1,499
Project_CodeNet
2,020
/** * Computing Geometry Library * @author Sshwy */ #include<bits/stdc++.h> using namespace std; #define pb push_back #define FOR(i,a,b) for(int i=(a);i<=(b);++i) #define ROF(i,a,b) for(int i=(a);i>=(b);--i) namespace cg{ typedef long double vtyp; const vtyp eps = 1e-9; bool isZero(vtyp x){ return -eps ...
2,007
Project_CodeNet
2,019
#include<iostream> #include<algorithm> #include<stdio.h> #include<cmath> using namespace std; struct point{ int x,y; }; struct line{ point s,t; }; struct bec{ int x,y; }; double keisan(point p, line l){ bec p1,p2,bl,bm; p1.x = p.x-l.s.x; p1.y=p.y-l.s.y; p2.x = p.x-l.t.x; p2.y=p.y-l.t.y; ...
960
Project_CodeNet
2,020
//By Vlgd #include<bits/stdc++.h> #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+p.y);} Point operator - (Point p){return Point(x-p.x,y-p.y);} Point operator ...
784
Project_CodeNet
2,018
// // Created by 李青坪 on 2018/11/29. // #include <cmath> #include <cstdio> #include <algorithm> #define COUNTER_CLOCKWISE 1 #define CLOCKWISE -1 #define ONLINE_BACK -2 #define ONLINE_FRONT 2 #define ON_SEGMENT 0 #define EPSLON 1e-10 #define equals(a, b) (fabs((a) - (b)) < EPSLON) #define MAXN 10000 #define NIL -1 usi...
1,023
Project_CodeNet
2,018
//include //------------------------------------------ #include <vector> #include <list> #include <map> #include <climits> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <...
874
Project_CodeNet
2,019
#include <bits/stdc++.h> using namespace std; const double eps = 1e-8; const double inf = 1e20; inline double sqr (double k) {return k * k;} inline int sgn (double p) { if (fabs (p) < eps) return 0; if (p < 0) return -1; return 1; } struct point { double x, y; point (){} point (double _x, double...
1,099
Project_CodeNet
2,020
#include<cstdio> #include<cmath> #include<iostream> #include<algorithm> using namespace std; const double ESP = 1e-8; class Point { public: double x, y; Point(double x = 0, double y = 0) : x(x), y(y) {} Point operator + (Point a) { return Point(x + a.x, y + a.y); } Point operator - (Point a) { return Point(x - ...
755
Project_CodeNet
2,019
#include "bits/stdc++.h" using namespace std; template <typename T> void printv(const vector<T> &v) { int sz = v.size(); for (int i = 0; i < sz; i++) { cout << v[i] << " \n"[i == sz - 1]; } } using ld = long double; using Point = std::complex<ld>; const ld eps = 1e-9, pi = acos(-1.0); names...
5,125
Project_CodeNet
2,017
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for (int i=0; i < (n); i++) typedef double D; // ??§?¨?????????????double???long double????????? typedef complex<D> P; // Point typedef pair<P, P> L; // Line typedef vector<P> VP; const D EPS = 1e-9; // ?¨±??????????????????????????£???????????? #d...
5,706
Project_CodeNet
2,018
#include<bits/stdc++.h> 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) { double a, b; is >> a >> b; p = Point(a, b); return is; } ostream &operator<<(o...
4,242
Project_CodeNet
2,019
#include <bits/stdc++.h> using namespace std; #define Fi first #define Se second #define pb push_back #define mp make_pair #define rep(x, a, b) for(int x = (a); x <= (b); ++ x) #define per(x, a, b) for(int x = (a); x >= (b); -- x) #define rop(x, a, b) for(int x = (a); x < (b); ++ x) #define por(x, a, b) for(int x = (a...
1,758
Project_CodeNet
2,020
#include <bits/stdc++.h> #define REP(i,n) for (int i = 0; i <(n); ++i) #define REP2(i,x,n) for (int i = x; i <(n); ++i) #define ALL(v) v.begin(), v.end() #define RALL(v) v.rbegin(), v.rend() using namespace std; using ll = long long; using P = pair<int,int>; static const double PI = acos(-1); static const int INF = 1e...
1,960
Project_CodeNet
2,019
#include <bits/stdc++.h> using namespace std; constexpr double EPS = 1e-10; typedef complex<double> Point; typedef Point Vector; typedef pair<Point, Point> Segment; typedef Segment Line; typedef pair<Point, double> Circle; typedef vector<Point> Polygon; double dot(Vector a, Vector b){ return real(a) * real(b) + imag(...
907
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) { return Point(x-p.x,y-p....
1,669
Project_CodeNet
2,017
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define rep(i,n) repl(i,0,n) #define each(itr,v) for(auto itr:v) #define pb(s) push_back(s) #define mp(a,b) make_pair(a,b) #define all(x) (x).begin(),(x).end() #define dbg(x) cout<<#x...
968
Project_CodeNet
2,019
#include <iostream> #include <cstdio> #include <cmath> using namespace std; const double EPS = 1e-7; const double INF = 1e12; struct Vec { double x,y; Vec(){} Vec(double x,double y){ this->x=x,this->y=y; } void read(){ scanf("%lf%lf",&x,&y); } void prt() {printf("%.9f %.9f\n",x,y); } double len(...
757
Project_CodeNet
2,017
#include <iostream> #include <cstdio> #include <algorithm> #include <cmath> using namespace std; #define EPS (1e-10) struct Point { double x, y; Point() {} Point(double _x,double _y):x(_x),y(_y) {} Point operator +(Point a) { return Point(x+a.x,y+a.y); } Point operator -(Point a) ...
612
Project_CodeNet
2,018
#include <iostream> #include <cmath> #include <vector> #include <set> #include <algorithm> 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....
2,554
Project_CodeNet
2,017
#include<iostream> #include<iomanip> #include<algorithm> #include<cmath> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) for(int i=0;i<(n);i++) #define PII pair<int,int> #define EPS (1e-10) #define equals(a,b) (fabs((a)-(b))<EPS) class Point { public: double x, y; Point(double X = 0...
1,242
Project_CodeNet
2,020
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define EPS (1e-10) #define equals(a, b) (fabs((a) - (b)) < EPS) const int COUNTER_CLOCKWISE = 1; const int CLOCKWISE = -1; const int ONLINE_BACK = 2; const int ONLINE_FRONT = -2; const int ON_SEGMENT = 0; class Point { public:...
1,326
Project_CodeNet
2,016
#include <algorithm> #include <cstdio> #include <cmath> 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 ); } ...
1,156
Project_CodeNet
2,019
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> #include<algorithm> #include<queue> #include<iostream> #include<set> #include<map> #define re register #define ll long long using namespace std; inline int gi(){ int f=1,sum=0;char ch=getchar(); while(ch>'9'|| ch<'0'){if(ch=='-')f=-1;ch=getchar(...
1,073
Project_CodeNet
2,020
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, N) for (int i = 0; i < (int)N; ++i) #define all(a) (a).begin(), (a).end() const double EPS = 1e-10; bool equals(double a, double b) { return fabs(a - b) < EPS; } class Point { public: double x, y; Point(double x = 0, double y = 0)...
2,577
Project_CodeNet
2,018
#include <stdio.h> #include <math.h> #include <iostream> 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,...
1,212
Project_CodeNet
2,015
#include <bits/stdc++.h> #include<stdio.h> using namespace std; #define FOR(i,k,n) for(int i = (k); i < (n); i++) #define REP(i,n) FOR(i,0,n) #define ALL(a) begin(a),end(a) #define MS(m,v) memset(m,v,sizeof(m)) #define D10 fixed<<setprecision(10) typedef vector<int> vi; typedef vector<string> vs; typedef pair<int, int...
1,172
Project_CodeNet
2,017
#include <bits/stdc++.h> using namespace std; struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; #define P(x) cout << (x) << "\n" #define p(x) cout << (x) #define all(c) (c).begin(), (c).end() #define rall(c) (c).rbegin(), (c).rend() #define vv(type, c, m, n, i) vector<vector<type>> c(m, vector<type>(n, i)...
980
Project_CodeNet
2,018
#include <bits/stdc++.h> using namespace std; struct F { long long a, b; F() {} F(long long _a, long long _b) : a(_a), b(_b) {} F operator + (const F &f) { long long x = a * f.a, y = b * f.a + a * f.b; long long g = __gcd(x, y); return F(x / g, y / g); } F operator - (const F &f) { long long x = a * f.a,...
1,584
Project_CodeNet
2,018
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define rep(i,n) FOR(i,0,n) #define pb emplace_back #define mp make_pair typedef long long ll; typedef pair<int,int> pint; #define eps (1e-10) struct Point{ double x,y; Point(){} Point(double x,double y):x(x),y(y){}...
972
Project_CodeNet
2,016
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using uint = unsigned int; using vi = vector<int>; using vb = vector<bool>; using vd = vector<double>; using vl = vector<ll>; using vvi = vector<vi>; using vvb = vector<vb>; using vvd = v...
1,223
Project_CodeNet
2,018
#include<stdio.h> #include<cstring> #include<algorithm> #include<vector> #include<map> #include<assert.h> #include<set> #include<cmath> #include<queue> #include<cstdlib> #include<iostream> #include<bitset> #define pii pair<int,int> #define fi first #define se second #define pb push_back #define rep(i,j,k) for(int i=(in...
869
Project_CodeNet
2,017
#include <stdio.h> #include <cmath> #include <algorithm> #include <cfloat> #include <stack> #include <queue> #include <vector> #include <string> #include <iostream> typedef long long int ll; typedef unsigned long long int ull; #define BIG_NUM 2000000000 #define MOD 1000000007 #define EPS 0.000000001 using namespace std...
848
Project_CodeNet
2,018
#include <bits/stdc++.h> using namespace std; using uint = unsigned int; using ll = long long; using ull = unsigned long long; constexpr ll TEN(int n) { return (n==0) ? 1 : 10*TEN(n-1); } template<class T> using V = vector<T>; template<class T> using VV = V<V<T>>; using D = double; const D PI = acos(D(-1)), EPS = 1e...
1,646
Project_CodeNet
2,019
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(ll (i) = (0);(i) < (n);++i) #define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i) #define PB push_back #define EB emplace_back #define MP make_pair #define FI first #define SE second #define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << end...
4,162
Project_CodeNet
2,019
// C++ 14 #include <math.h> #include <iostream> #include <vector> #include <list> #include <algorithm> #include <queue> #include <stack> #include <set> #include <map> #include <unordered_map> #define ll long long #define Int ll #define loop(x, start, end) for(Int x = start; x < end; x++) #define loopdown(x, start, end...
1,087
Project_CodeNet
2,018
#include <iostream> #include <cmath> #include <string> #include <cstdio> #include <algorithm> #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){ this->x = x; this->y = y; } Point operator+(co...
1,704
Project_CodeNet
2,020
#include<stdio.h> #include<math.h> #include<vector> #include<algorithm> #define dTolerance 1.0e-10 using namespace std; struct POINT{ double x; double y; }; int LF_COUNTER_CLOCKWIZE(const POINT &p, const POINT &p0, const POINT &p1){ if((p1.x - p0.x) * (p.y - p0.y) - (p.x - p0.x) * (p1.y - p0.y) > dTolera...
1,281
Project_CodeNet
2,019
#include<bits/stdc++.h> #define eps (1e-10) 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);} Point operator * (double a){return Point(a*x,a*y);} Poi...
1,770
Project_CodeNet
2,017
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<n;++i) typedef complex<double> Point; #define X real() #define Y imag() const double EPS = 1e-9; #define EQ(n,m) (abs((n)-(m)) < EPS) // ?????????dot(a,b) = |a||b|cos?? double dot(Point a, Point b) { return a.X*b.X + a.Y*b.Y; } // ????????...
695
Project_CodeNet
2,020
#include <bits/stdc++.h> using namespace std; // 定義・定数 using P = complex<double>; const double EPS = 1e-10; namespace std { // 点の比較演算子 bool operator < (const P &a, const P &b) { return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b); } // 点の等価演算子 bool operator == (const P &a, const P &b) {...
1,480
Project_CodeNet
2,019
#include<bits/stdc++.h> using namespace std; #define ld long double #define eps 1e-9 bool cmp(ld A , ld B){return A + eps > B && A - eps < B;} struct vec{ ld x , y; vec(ld _x = 0 , ld _y = 0) : x(_x) , y(_y){} friend vec operator +(vec A , vec B){return vec(A.x + B.x , A.y + B.y);} friend vec operator -(vec A , ...
835
Project_CodeNet
2,017
#include <bits/stdc++.h> using namespace std; typedef double ll; struct Point { ll x,y; Point(){ x = y = 0.0; } Point(ll _x, ll _y) : x(_x), y(_y){} Point operator+ (Point p) { return Point(p.x + x, p.y + y); } Point operator- (Point p) { return Point(x - p.x, y - p....
891
Project_CodeNet
2,019
#include<bits/stdc++.h> #define rep(i, n) for(int i = 1, i##_end_ = (n); i <= i##_end_; ++i) using namespace std; typedef pair<int, int> pii; typedef long long ll; const double eps = 1e-10; int sgn(double x) { if(fabs(x) < eps) return 0; return x < 0 ? -1 : 1; } struct Point { double x, y; Point(doubl...
1,466
Project_CodeNet
2,020
#include <bits/stdc++.h> #include <cmath> using namespace std; typedef long long ll; //typedef unsigned long long ll; #define rep(i, n) for (int i = 0; i < (n); ++i) //#define rep(i, n) for (ll i = 0; i < (n); ++i) //#define sz(x) ll(x.size()) //typedef pair<ll, int> P; typedef pair<ll, ll> P; //const double INF = 1e...
1,888
Project_CodeNet
2,019
#include <complex> #include <cmath> #include <algorithm> using Real = long double; const Real EPS = 1e-10; // 宇宙船演算子 inline Real compare(Real a, Real b) { if (std::abs(a - b) < EPS) return 0; return a - b > 0 ? 1 : -1; } template <class T> inline T sq(T x) { return x * x; } using Point = std::complex<Real...
986
Project_CodeNet
2,020
#pragma GCC optimize(3,"Ofast","inline") #pragma GCC target("avx") #include <bits/stdc++.h> using namespace std; template<class t> inline t read(t &x){ char c=getchar();bool f=0;x=0; while(!isdigit(c)) f|=c=='-',c=getchar(); while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar(); if(f) x=-x;return x; } te...
1,108
Project_CodeNet
2,018
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <queue> #include <vector> #include <utility> #define EPS 1e-10 using namespace std; typedef long long ll; struct Point{ double x,y; Point(double x = 0.0,double y = 0.0): x(x),y(y) {} Point operator + (Point p){ ...
973
Project_CodeNet
2,020
#include<bits/stdc++.h> using namespace std; #define E 1e-18 #define ll long long #define int long long #define db double #define For(i,j,k) for(int i=(int)(j);i<=(int)(k);i++) #define Rep(i,j,k) for(int i=(int)(j);i>=(int)(k);i--) inline ll read(){ ll x=0;char ch=getchar();bool f=0; for(;!isdigit(ch);ch=getchar()) i...
1,397
Project_CodeNet
2,019
//AOJ-CGL-2-D #include <bits/stdc++.h> using namespace std; #define REP(i,a) for(int i = 0; i < (a); i++) #define ALL(a) (a).begin(),(a).end() typedef long long ll; typedef pair<int, int> P; const int INF = 1e9; const int MOD = 1e9 + 7; #define EPS (1e-10) #define equals(a, b) (fabs((a) - (b)) < EPS ) struct Point { ...
1,924
Project_CodeNet
2,020
//Distance //#include<bits/stdc++.h> //#pragma GCC optimize(3,"Ofast","inline") #include<iostream> #include<string> #include<algorithm> #include<cstdio> #include<cstring> #include<cmath> #include<vector> //#include<random> #include<cstdlib> #include<ctime> #include<fstream> #include<map> #include<stack> #include<queue>...
2,068
Project_CodeNet
2,019
#include<bits/stdc++.h> using namespace std; typedef long long lint; typedef long double louble; template<typename T1,typename T2> inline T1 max(T1 a,T2 b){return a<b?b:a;} template<typename T1,typename T2> inline T1 min(T1 a,T2 b){return a<b?a:b;} namespace ae86 { const int bufl = 1<<15; char buf[bufl],*s=buf,*t...
1,076
Project_CodeNet
2,020
#include<iostream> #include<stdio.h> #include<math.h> #include<algorithm> #include<string> #include<map> 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...
1,238
Project_CodeNet
2,018
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include<bits/stdc++.h> #define INF 1e9 #define EPS 1e-9 #define REP(i,n) for(lint i=0,i##_len=(n);i<i##_len;++i) #define REP1(i,n) for(lint i=1,i##_len=(n);i<=i##_len;++i) #define REPR(i,n) for(lint i=(n)-1;i>=0;--i) #define REPR1(i,n) f...
2,041
Project_CodeNet
2,020
#include<bits/stdc++.h> #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 + p.y); } Point operator - (Point p) {return Point(x...
1,109
Project_CodeNet
2,020
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < (n) ; i++) constexpr auto INF = 2147483647; static const double EPS = pow(10,-10); typedef long long ll; static int COUNTER_CLOCKWISE = 1; static int CLOCKWISE = -1; static int ONLINE_BACK = 2; static int ONLINE_FRONT = -2; static int ON_S...
986
Project_CodeNet
2,020
#include <iostream> #include <cmath> #include <cstdio> using namespace std; struct Point { double x; double y; }; double min(double a, double b) { if(a < b) return a; else return b; } double norm(Point p0, Point p1) { return sqrt(pow(p1.x - p0.x, 2) + pow(p1.y - p0.y, 2)); } double dot(Point p...
777
Project_CodeNet
2,016
#include <iostream> #include <fstream> #include <typeinfo> #include <vector> #include <cmath> #include <set> #include <map> #include <string> #include <algorithm> #include <cstdio> #include <queue> #include <iomanip> #include <cctype> #define syosu(x) fixed<<setprecision(x) using namespace std; typedef long long ll; ty...
1,318
Project_CodeNet
2,019
#include <iostream> #include <cmath> #include <vector> #include <algorithm> #include <iomanip> #include <cstring> #include <cstdio> // 计算几何模板 //二维平面 using namespace std; const double eps = 1e-8; const double inf = 1e20; const double pi = acos(-1.0); const int maxp = 1010; //Compares a double to zero int sgn(double x){ ...
2,222
Project_CodeNet
2,017
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef double R;//double long double ??????????????? cmath?????¢??°??????????????????????????????????????????????????§???????????? typedef complex<R> Point; typedef pair<Point , Point> Line; typedef pair<Point ,R > Cir...
2,394
Project_CodeNet
2,019
#include<bits/stdc++.h> using namespace std; typedef long long unsigned int ll; // 参考サイト // 前原 貴憲 // http://www.prefield.com/algorithm/index.html const double EPS = 1e-8; const double INF = 1e12; typedef complex<double> Point; //複素数で平面定義 typedef Point P; // system {{{ // オペレーター< を定義、後々楽 namespace std{ bool opera...
1,675