Source
stringclasses
1 value
Date
int64
2.01k
2.02k
Text
stringlengths
22
783k
Token_count
int64
20
394k
Project_CodeNet
2,012
#include<iostream> #include<cstdio> #include<cmath> #include<cassert> #include<iomanip> #include<algorithm> #include<vector> #include<map> #include<cstdlib> #include<sstream> #define EPS 1e-10 #define F first #define pb push_back #define S second #define REP(i,s,n) for(int i=s;i<n;i++) #define rep(i,n) REP(i,0,n) #defi...
755
Project_CodeNet
2,012
#include <cstdio> #include <iostream> #include <vector> #include <list> #include <cmath> #include <fstream> #include <algorithm> #include <string> #include <queue> #include <set> #include <map> #include <complex> #include <iterator> #include <cstdlib> #include <cstring> #include <sstream> using namespace std; #define...
2,193
Project_CodeNet
2,019
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<pair<int, int>> p(n); for(int i=0; i<n; i++){ cin >> p[i].first >> p[i].second; } if(n&1){ cout << "NA" << endl; return 0; } int ax, ay; for(int i=0; i*2 < n; i++){ int ...
225
Project_CodeNet
2,017
#include <stdio.h> #include <cmath> #include <algorithm> #include <cfloat> #include <stack> #include <queue> #include <vector> #include <string> #include <iostream> #include <set> #include <map> typedef long long int ll; typedef unsigned long long int ull; #define BIG_NUM 2000000000 #define MOD 1000000007 #define EPS 0...
586
Project_CodeNet
2,020
#include<bits/stdc++.h> using namespace std; #define F first #define S second #define MP make_pair typedef pair<double, double> P; typedef complex<double> xy_t; int n; xy_t p[50]; // 図 (1) 内積: a.x*b.x +a.y*b.y double dot_product(xy_t a, xy_t b) { return (conj(a)*b).real(); } // 図 (2) クロス (外) 積, ベクトル a,b が作る三角形の符号付き面積の二...
410
Project_CodeNet
2,014
#include <iostream> #include <vector> #include <complex> #include <cstdio> using namespace std; #define all(c) c.begin(),c.end() #define loop(i,a,b) for(int i=(a);i<int(b);i++) #define rep(i,n) loop(i,0,n) typedef long long ll; typedef complex<double> P; typedef vector<P> Pol; P NA(1e10,1e10); P solve(Pol const& p...
278
Project_CodeNet
2,017
#include "bits/stdc++.h" using namespace std; //#define int long long #define DBG 1 #define dump(o) if(DBG){cerr<<#o<<" "<<(o)<<" ";} #define dumpl(o) if(DBG){cerr<<#o<<" "<<(o)<<endl;} #define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;} #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep...
3,739
Project_CodeNet
2,018
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; const double EPS = 1e-9; int N; int X[50], Y[50]; bool equal(double x, double y) { return abs(x-y) < EPS; } double calc(double x, double y) { return (x+y)/2.0; } int main() { cin.tie(0); ios_base::sync_with_stdio...
287
Project_CodeNet
2,017
#include<bits/stdc++.h> #define range(i,a,b) for(int i = (a); i < (b); i++) #define rep(i,b) for(int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; const int INF = 1e8; using namespace std; typedef complex<double> Point; typedef Point Vector; //?????????...
4,070
Project_CodeNet
2,013
#include<iostream> #include<complex> #include<cstdio> using namespace std; #define rep(i, n) for (int i = 0; i < int(n); ++i) typedef complex<long long> P; int main() { long long n; cin >> n; if (n == -1) { cout << "NA" << endl; return 0; } P p[n]; rep (i, n) cin >> p[i].real() >> p[i].imag(); ...
215
Project_CodeNet
2,019
#if __has_include("../library/Basic/Debug.hpp") #include "../library/Basic/Debug.hpp" #else /* ----- Header Files ----- */ // IO #include <cstdio> #include <iomanip> #include <ios> #include <iostream> // algorithm #include <algorithm> #include <cmath> #include <numeric> // container #include <vector> #include <str...
1,099
Project_CodeNet
2,016
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int,int> pii; #define rep(i,n) for(ll i=0;i<(ll)(n);i++) #define all(a) (a).begin(),(a).end() #define pb push_back #define INF (1e9+1) //#define INF (1LL<<59) #define OUT 0 #define ON 1 #define IN 2 #define EPS (1e-10) class P{ ...
781
Project_CodeNet
2,019
#include <iostream> #include <algorithm> #include <vector> #include <utility> #include <queue> #include <math.h> #include <stdio.h> #define eps 1e-9 using namespace std; int n; double x[55], y[55]; double distPP(double x, double y, double x2, double y2) { return sqrt((x-x2)*(x-x2) + (y-y2)*(y-y2)); } int main(void)...
270
Project_CodeNet
2,019
#include <iostream> #include <iomanip> #include <cstdio> #include <string> #include <cstring> #include <deque> #include <list> #include <queue> #include <stack> #include <vector> #include <utility> #include <algorithm> #include <map> #include <set> #include <complex> #include <cmath> #include <limits> #include <cfloat...
6,944
Project_CodeNet
2,018
#define __USE_MINGW_ANSI_STDIO 0 #include <bits/stdc++.h> using namespace std; using ll = long long; #define int ll using VI = vector<int>; using VVI = vector<VI>; using PII = pair<int, int>; #define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #defi...
1,134
Project_CodeNet
2,019
#include <iostream> #include <vector> #include <cmath> #include <iomanip> #include <algorithm> using namespace std; using DD = double; const DD INF = 1LL<<60; // to be set appropriately const DD EPS = 1e-10; // to be set appropriately const DD PI = acos(-1.0); DD torad(int deg) {return (DD)(deg) * PI / 180...
888
Project_CodeNet
2,013
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <numeric> #includ...
444
Project_CodeNet
2,014
#include <cstdio> #include <cstdlib> #include <cstring> #include <climits> #include <cassert> #include <iostream> #include <iomanip> #include <sstream> #include <algorithm> #include <numeric> #include <complex> #include <stack> #include <queue> #include <list> #include <set> #include <map> #include <bitset> #include <f...
1,814
Project_CodeNet
2,020
#include <bits/stdc++.h> using namespace std; int main(){ cout << fixed << setprecision(4); int N; cin >> N; vector<int> X(N), Y(N); for (int i = 0; i < N; i++){ cin >> X[i] >> Y[i]; } if (N % 2 == 1){ cout << "NA" << endl; } else { int Px = 0, Py = 0; for (int i = 0; i < N; i++){ ...
282
Project_CodeNet
2,017
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define fi first #define se second #define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++) #define rep(i,n) repl(i,0,n) #define each(itr,v) for(auto itr:v) #define pb push_back #define all(x) (x).begin(),(x).end() #define ...
688
Project_CodeNet
2,018
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(int)n;i++) int main(){ int n; cin >> n; vector<complex<double> > p(n); rep(i,n){ double x,y; cin >> x >> y; p[i] = complex<double>(x,y); } if(n%2!=0){ cout << "NA" << endl; return 0; } complex<double> ...
218
Project_CodeNet
2,020
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define all(x) (x).begin(),(x).end() const int mod=1000000007,MAX=200005,INF=1<<20; int main(){ std::ifstream in("text.txt"); std::cin.rdbuf(in.rdbuf()); cin.tie(0); ios::sync_with_stdio(false); int N;cin>>N; vector<p...
281
Project_CodeNet
2,012
#include <iostream> #include <algorithm> #include <complex> #include <vector> #include <cstdio> using namespace std; typedef pair<double, double> Point; const double EPS = 1e-8; double cross(Point a, Point b){ return a.first * b.second - a.second * b.first; } double dist(Point a, Point b){ return (a.first - b....
407
Project_CodeNet
2,016
#include <bits/stdc++.h> using namespace std; typedef complex<double> P; typedef pair<P,P> L; const double EPS=1e-6; double cross(P a, P b){ return imag(conj(a)*b); } P crossPoint(L l, L m){ double A = cross(l.second - l.first, m.second - m.first); double B = cross(l.second - l.first, l.second - m.first); if(fa...
335
Project_CodeNet
2,013
#include<stdio.h> int x[51]; int y[51]; int main(){ int a; scanf("%d",&a); if(a%2){ printf("NA\n"); return 0; } for(int i=0;i<a;i++){ scanf("%d%d",x+i,y+i); } x[a]=x[0]; y[a]=y[0]; bool ok=true; for(int i=0;i<a/2;i++){ int ax=x[i+1]-x[i]; int ay=y[i+1]-y[i]; int bx=x[i+a/2+1]-x[i+a/2]; int by=y[...
230
Project_CodeNet
2,018
#include<iostream> #include<iomanip> using namespace std; int n; double x[50],y[50]; main() { cin>>n; for(int i=0;i<n;i++)cin>>x[i]>>y[i]; if(n%2)cout<<"NA"<<endl; else { n=n/2;bool f=1; for(int i=0;i<n;i++) { f&=x[i+1]-x[i]==x[n+i]-x[(n+i+1)%(n*2)]; f&=y[i+1]-y[i]==y[n+i]-y[(n+i+1)%(n*2)]; } if(f)...
200
Project_CodeNet
2,017
#include <bits/stdc++.h> using namespace std; using vi=vector<int>; using vvi=vector<vi>; using vs=vector<string>; using msi=map<string,int>; using mii=map<int,int>; using pii=pair<int,int>; using vlai=valarray<int>; using ll=long long; #define rep(i,n) for(int i=0;i<n;i++) #define range(i,s,n) for(int i=s;i<n;i++) #de...
374
Project_CodeNet
2,019
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0,i##_cond=(n);i<i##_cond;++i) #define FOR(i,a,b) for(int i=(a),i##_cond=(b);i<i##_cond;++i) const double EPS = 1e-8; using P = complex<double>; using G = vector<P>; signed main(){ int n; cin >> n; G g(n); rep(i,n){ double x, y; cin >...
250
Project_CodeNet
2,016
#include <bits/stdc++.h> using namespace std; #define EPS (1e-10) #define equals(a, b) (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) { return Point(x + p.x, y + p.y); } Point operator - (Point p) { return...
1,601
Project_CodeNet
2,017
#include <iostream> #include <cstdio> using namespace std; int n; int x[50], y[50]; int main() { int i; cin >> n; if (n % 2) { cout << "NA" << endl; return 0; } for (i = 0; i < n; i++) cin >> x[i] >> y[i]; for (i = 0; i < n; i++) { if (x[(i + 1) % n] - x[i] != x[(n/2 + i) % n] - x[(n/2 + i + 1) % n]) break;...
255
Project_CodeNet
2,016
#include <bits/stdc++.h> using namespace std; #define EPS 1e-10 #define INF 1e9 #define equal(a,b) (fabs(a-b) < EPS) 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 Poin...
578
Project_CodeNet
2,015
#include <bits/stdc++.h> using namespace std; typedef pair<double,double> P; int main() { int n; cin >> n; P a[n]; for(int i=0; i<n; i++) cin >> a[i].first >> a[i].second; P p=P(a[0].first+a[n/2].first,a[0].second+a[n/2].second); bool ok=1; for(int i=1; i<n/2; i++) { if(p!=P(a[i].first+a[i+n/2].first...
185
Project_CodeNet
2,016
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(auto i=(n)*0;i<n;i++) #define range(it,v) for(auto & it:v) typedef double D; typedef complex<D> P; typedef vector<P> Poly; #define IL inline #define X real() #define Y imag() IL D dot(P a,P b){ return a.X*b.X+a.Y*b.Y; } IL D cross(P a,P b){ re...
457
Project_CodeNet
2,018
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, a) for (int i = 0; (i) < (int) (a); (i)++) #define reps(i, a, b) for (int i = (int) (a); (i) < (int) (b); (i)++) #define rrep(i, a) for (int i = (int) a-1; (i) >= 0; (i)--) #define rreps(i, a, b) for (int i = (int) (a)-1; (i) >= (int) ...
538
Project_CodeNet
2,017
#include <bits/stdc++.h> using namespace std ; #define pb(n) push_back(n) #define fi first #define se second #define all(r) begin(r),end(r) #define vmax(ary) *max_element(all(ary)) #define vmin(ary) *min_element(all(ary)) #define debug(x) cout<<#x<<": "<<x<<endl #define fcout(n) cout<<fixed<<setprecision((n)) #define ...
2,515
Project_CodeNet
2,020
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,n) for(long long i=0; i<(n); i++) template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } in...
334
Project_CodeNet
2,013
#include <iostream> #include <sstream> #include <string> #include <algorithm> #include <vector> #include <stack> #include <queue> #include <set> #include <map> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <cassert> using namespace std; #define FOR(i,k,n) for(int i=(k); i<(int)(n);...
637
Project_CodeNet
2,018
#include<bits/stdc++.h> using namespace std; using ld=long double; using P=complex<ld>; int main(){ int n; cin>>n; vector<P> p(n); for(int i=0;i<n;i++){ ld x,y; cin>>x>>y; p[i]=P(x,y); } if(n%2){ cout<<"NA"<<endl; return 0; } P res=P(0.5,0)*(...
211
Project_CodeNet
2,020
#include <iostream> #include <vector> #include <cstdio> #include <cmath> using namespace std; #define equals(a,b) (abs(a-b)<1e-9) int main() { int n; cin >> n; vector<double> x(n), y(n); for (int i = 0; i < n; ++i) cin >> x[i] >> y[i]; bool f = !(n & 1); double px = (x[0] + x[n / 2]) / 2, py = (y[0] + y[n / 2])...
231
Project_CodeNet
2,019
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<pair<int, int>> p(n); for(int i=0; i<n; i++){ cin >> p[i].first >> p[i].second; } if(n&1){ cout << "NA" << endl; return 0; } int ax, ay; for(int i=0; i*2 < n; i++){ int ...
225
Project_CodeNet
2,016
#include<bits/stdc++.h> #define EPS (1e-10) #define equals(a,b) (fabs((a)-(b)) < EPS) using namespace std; struct Point{ 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 operat...
374
Project_CodeNet
2,019
// 解説を見た なるほど #include<iostream> #include<cmath> #include<iomanip> using namespace std; bool equals(double x, double y){ return fabs(x-y) < 1e-6; } int main(){ int n; cin >> n; if(n%2){ cout << "NA" << endl; return 0; } double x[n], y[n]; for(int i = 0; i < n; i++) cin >> ...
246
Project_CodeNet
2,020
#include <bits/stdc++.h> //typedef //-------------------------#include <bits/stdc++.h> const double pi = 3.141592653589793238462643383279; using namespace std; template<typename T=int>inline T readT() { char c = getchar_unlocked(); bool neg = (c=='-'); T res = neg?0:c-'0'; while(isdigit(c=getchar_unlocked...
4,561
Project_CodeNet
2,019
#include "iostream" #include "climits" #include "list" #include "queue" #include "stack" #include "set" #include "functional" #include "algorithm" #include "string" #include "map" #include "unordered_map" #include "unordered_set" #include "iomanip" #include "cmath" #include "random" #include "bitset" #include "cstdio" ...
382
Project_CodeNet
2,016
/* * 2442.cc: ConvexCut */ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<iostream> #include<string> #include<vector> #include<map> #include<set> #include<stack> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #in...
1,886
Project_CodeNet
2,014
#define _USE_MATH_DEFINES #include <algorithm> #include <cstdio> #include <functional> #include <iostream> #include <cfloat> #include <climits> #include <cstring> #include <cmath> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <time.h> #include <vector> usi...
381
Project_CodeNet
2,014
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> PI; const double EPS=1e-8; #define rep(i,n) for(int i=0;i<(int)(n);++i) #define F first #define S second #define mp(a,b) make_pair(a,b) #define pb(a) push_back(a) #define SZ(a) (int)((a).size()) #define ALL(a) (a).begin(),(a).end...
638
Project_CodeNet
2,015
#include <bits/stdc++.h> using namespace std; inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;} template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();} template<class T> inline T sqr(T x) {return x*x;} typedef vector<int> vi; typedef vector<vi> vvi; typed...
3,810
Project_CodeNet
2,020
#include<bits/stdc++.h> #define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i) #define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i) #define foreach(i, n) for(auto &i:(n)) #define pii pair<int, int> ...
947
Project_CodeNet
2,015
#include<iostream> #include<complex> #include<vector> #include<math.h> #include<stdio.h> using namespace std; typedef complex<double> po; vector<po>vec; int main(){ int N; cin>>N; if(N%2==1){ cout<<"NA"<<endl; return 0; } for(int i=0;i<N;i++){ double x,y; cin>>x>>y;...
314
Project_CodeNet
2,018
#include <bits/stdc++.h> using namespace std; using ld = long double; int main() { int N; cin >> N; vector<int> X(N), Y(N); for (int i = 0; i < N; i++) { cin >> X[i] >> Y[i]; } if (N & 1) { puts("NA"); return 0; } int posX = X[0] + X[N / 2], posY = Y[0] + Y[N / 2]; bool ng = false; for (int i = 0; i < ...
241
Project_CodeNet
2,020
// #define DEBUGGING #include <bits/stdc++.h> #define endl '\n' #define ALL(V) (V).begin(), (V).end() #define ALLR(V) (V).rbegin(), (V).rend() using ll = std::int64_t; using ull = std::uint64_t; using PLL = std::pair<ll, ll>; using TLL = std::tuple<ll, ll, ll>; template <typename T> using V = std::vector<T>; template <...
2,083
Project_CodeNet
2,016
//------------- //| ConvexCut | //| H28.03.12 | //------------- //---includes---// #include<iostream> #include<cmath> #include<iomanip> #include<vector> #include<algorithm> using namespace std; //---defines---// #define MAX_N 100000 #define EPS 1e-14 #define EPS2 1e-6 #define INF 1e14 #define INF2 1e12 //---ints---/...
1,081
Project_CodeNet
2,015
#include <cstdio> #include <cstring> #include <cmath> #include <map> using namespace std; #define EPS 1e-10 struct P{ double x,y; P(){} P(double xx,double yy){ x=xx; y=yy; } }; double add(double a,double b){ if(fabs(a+b)<EPS*(fabs(a)+fabs(b)))return 0.0; return a+b; } int n; int x[51],y[51]; int main(void){...
289
Project_CodeNet
2,016
#include <bits/stdc++.h> using namespace std; int main(){ cout.precision(16); cout.setf(ios::fixed); int N; cin >> N; vector<double> X(N), Y(N); for(int i=0; i<N; i++) cin >> X[i] >> Y[i]; bool ok = true; for(int i=0; i<N/2; i++){ int dx = X[i+1] - X[i] + X[(i+1+N/...
233
Project_CodeNet
2,016
#include<bits/stdc++.h> #define f first #define s second using namespace std; typedef long double ld; typedef pair<ld,ld> P; int n; P p[50]; ld getdis(P a,P b){ return (a.f-b.f)*(a.f-b.f)+(a.s-b.s)*(a.s-b.s); } P cal(){ ld a=0,cx=0,cy=0; for (int i=n,u=0;i-->0;u=i) { ld k=p[i].f*p[u].s-p[u].f*p[i].s; a+...
303
Project_CodeNet
2,016
#include <iostream> #include <string> #include <sstream> #include <algorithm> #include <vector> #include <utility> #include <functional> #include <stack> #include <queue> #include <map> #include <set> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <deque> #include <ctime> using nam...
554
Project_CodeNet
2,017
#include <iostream> #include <iomanip> #include <complex> #include <vector> #include <cmath> #define EPS 1e-8 using namespace std; typedef complex<double> P; int main(){ int n; cin >> n; vector<P> G(n); for(int i=0; i<n; i++){ int x,y; cin >> x >> y; G[i] = P(x,y); } i...
259
Project_CodeNet
2,018
#include <cstdio> using namespace std; int X[60], Y[60]; int main() { int N; scanf("%d", &N); for(int i=0; i<N; i++) { scanf("%d%d", &X[i], &Y[i]); } if(N % 2) { printf("NA\n"); } else { int px = X[0] + X[N/2], py = Y[0] + Y[N/2]; bool ok = true; for(int...
234
Project_CodeNet
2,019
/* 友利奈緒ぱわーでACしてくれ!!!!!!!!!!!! Charlotteまだ見てない人は見ような!!!!!!! /  /:/              \:ヽ \         /  /                     \  ヽ      \__L 彡                    ヽ  ',        フ /   /  /  /   ,         ヽ  ',  j        レ    /  /  /                ',  ヽ j         //...
2,611
Project_CodeNet
2,020
// >>> TEMPLATES #include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using i32 = int32_t; using i64 = int64_t; using u32 = uint32_t; using u64 = uint64_t; #define int ll #define double ld #define rep(i,n) for (int i = 0; i < (int)(n); i++) #define rep1(i,n) for (int i = 1; i <= (...
1,404
Project_CodeNet
2,012
#include <iostream> #include <iomanip> #include <sstream> #include <cstdio> #include <string> #include <vector> #include <algorithm> #include <complex> #include <cstring> #include <cstdlib> #include <cmath> #include <cassert> #include <climits> #include <queue> #include <set> #include <map> #include <valarray> #include...
408
Project_CodeNet
2,020
#include <bits/stdc++.h> using namespace std; static double eps = 1e-9; int main(){ int N; cin>>N; double x[50+10],y[50+10]; for(int i=0; i<N; i++) cin>>x[i]>>y[i]; bool check = true; if(N % 2 != 0) check = false; double px,py; px = (x[0] + x[N/2]) / 2; py = (y[0] + y[N/2]) / 2; ...
267
Project_CodeNet
2,018
#include "bits/stdc++.h" #define REP(i,n) for(int i=0;i<(int)(n);i++) #define ALL(x) (x).begin(),(x).end() using namespace std; /* ??????????????¬ */ #include <complex> typedef long double ld; typedef complex<ld> Point;//????´???° const ld eps = 1e-9, pi = acos(-1.0); namespace std { bool operator<(cons...
3,073
Project_CodeNet
2,018
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; float x[N],y[N]; for(int i=0;i<N;i++){ cin>>x[i]>>y[i]; } if(N%2==1){ cout<<"NA"<<endl; return 0; } float tx,ty; tx=(x[0]+x[N/2])/2; ty=(y[0]+y[N/2])/2; for(int i=0;N/2+i<N;i++){ int a,b,c,d; a=i; b=N...
547
Project_CodeNet
2,015
#include<bits/stdc++.h> using namespace std; typedef complex<double> P; typedef pair<P,P> L; //Line, Segment const int SPLIT = 10000; const double EPS = 1e-9; namespace std { bool operator < (const P& a, const P& b){ return fabs(real(a)-real(b)) < EPS ? imag(a) < imag(b) : real(a) < real(b); } } namespace ...
1,334
Project_CodeNet
2,015
#include<bits/stdc++.h> using namespace std; struct point{ int x,y; }; int n; point p[50]; void solve(){ bool flg=true; int X=0,Y=0; if(n%2)flg=false; for(int i=0;i<n&&flg;i++){ int j=(i+1)%n; int i2=(i+n/2)%n; int j2=(j+n/2)%n; point v=(point){p[i].x-p[j].x,p[i].y-p[j].y}; point w=(p...
265
Project_CodeNet
2,020
#include <bits/stdc++.h> #define syosu(x) fixed<<setprecision(x) using namespace std; typedef long long ll; typedef unsigned int uint; typedef unsigned long long ull; typedef pair<int,int> P; typedef pair<double,double> pdd; typedef pair<ll,ll> pll; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<double>...
449
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...
598
Project_CodeNet
2,014
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<(int)(n);i++) using namespace std; typedef long double ld; typedef complex<ld> P; typedef vector<P> VP; const ld eps = 1e-8, pi = acos(-1.0); #define EQ(a,b) (abs((a)-(b))<eps) ld dot (P a, P b) { return real(conj(a) * b); } ld cross (P a, P b) { return imag(...
464
Project_CodeNet
2,016
#include <bits/stdc++.h> using namespace std; typedef complex<double> P; typedef pair<P,P> L; const double EPS=1e-6; double cross(P a, P b){ return imag(conj(a)*b); } P crossPoint(L l, L m){ double A = cross(l.second - l.first, m.second - m.first); double B = cross(l.second - l.first, l.second - m.first); if(fa...
335
Project_CodeNet
2,014
#include<iostream> #include<set> #include<utility> using namespace std; int N; int x[50],y[50]; int main(){ cin>>N; for(int i=0;i<N;i++){ cin>>x[i]>>y[i]; } set<pair<int,int> >s; for(int i=0;i+N/2<N;i++){ s.insert(make_pair(x[i]+x[i+N/2],y[i]+y[i+N/2])); } if(N%2==1||s.size()>1){ cout<<"NA"...
161
Project_CodeNet
2,019
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef long double ld; typedef vector<ld> vd; typedef bool bl; typedef vector<bl> vb; typedef unordered_map<ll,unordered_map<ll,ll>> graph; const ll e5 = 1 << 20; const ll mod = 1000000007; const ll e3 = 1 << 13; const ll INF...
393
Project_CodeNet
2,017
#include <bits/stdc++.h> #define ll long long #define INF 1000000005 #define MOD 1000000007 #define EPS 1e-10 #define rep(i,n) for(int i=0;i<n;++i) using namespace std; typedef pair<int,int>P; const int MAX_N = 100005; vector<P> vec; int n; int main() { scanf("%d",&n); if(n % 2){ printf("NA\n"); ...
288
Project_CodeNet
2,018
#include <stdio.h> #include <iostream> #include <vector> #include <string> #include <math.h> #include <algorithm> using namespace std; #define INF 0x7FFFFFFF const double EPS = 1e-10; inline bool eq(double a, double b) { return fabs(b - a) < EPS;} struct p_t{ double x; double y; }; int main(){ int n; cin>>...
288
Project_CodeNet
2,020
#ifdef LOCAL #define _GLIBCXX_DEBUG #define __clock__ #else #pragma GCC optimize("Ofast") #endif #include<bits/stdc++.h> using namespace std; using ll = long long; using VI = vector<ll>; using VV = vector<VI>; using VS = vector<string>; using PII = pair<ll, ll>; // tourist set template <typename A, typenam...
1,510
Project_CodeNet
2,017
#include <iostream> #include <vector> #include <algorithm> #include <iomanip> #define rep(i, n) for(int i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef pair<ll, ll> Q; int n; int x[50]; int y[50]; Q sx[25]; Q sy[25]; ll gcd(ll a, ll b){ return b == 0 ? a : gcd(b, a % b); } void make_...
761
Project_CodeNet
2,020
#include<bits/stdc++.h> using namespace std; #define ALL(x) x.begin(),x.end() #define rep(i,n) for(int i=0;i<(n);i++) #define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl; #define mod 1000000007 using ll=long long; const int INF=1000000000; const ll LINF=1001002003004005006ll; int dx[]={1,0,-1,0},dy[]=...
4,221
Project_CodeNet
2,016
#include "bits/stdc++.h" #include<unordered_map> #include<unordered_set> #pragma warning(disable:4996) using namespace std; using ld = long double; template<class T> using Table = vector<vector<T>>; const ld eps=1e-9; //// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt" #include <com...
5,949
Project_CodeNet
2,016
/* ?????????????????¨?????????????????¨???????????? ????±???¨?????????????????????????????¨????????????????????¨???????????´??????????????°???????????¶???????????°??¢ */ #include <iostream> #include <algorithm> #include <functional> #include <vector> #include <cmath> using namespace std; typedef long long ll; typedef p...
653
Project_CodeNet
2,013
#include <iostream> #include <complex> #include <algorithm> #include <numeric> #include <vector> #include <cassert> #include <string> #include <memory.h> #include <queue> #include <cstdio> #include <cstdlib> #include <set> #include <map> #include <cctype> #include <iomanip> #include <sstream> #include <cctype> #include...
405
Project_CodeNet
2,017
#include <vector> #include <iostream> #include <iomanip> #include <algorithm> using namespace std; using ll = long long; int main() { int N; cin >> N; using P = pair<ll, ll>; vector<P> p(N); for (int i = 0; i < N; i++) { cin >> p[i].first >> p[i].second; } if (N % 2 == 1) { ...
281
Project_CodeNet
2,019
#include <bits/stdc++.h> using namespace std; using LL = long long; #define fs first #define sc second const LL MOD = 1e9+7; const double EPS = 1e-10; template<class T>bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template<class T>bool chmin(T &a, const T &b) { if (b <...
1,653
Project_CodeNet
2,016
#include <bits/stdc++.h> using namespace std; int main() { cout << fixed << setprecision(15); int N, X[50], Y[50]; cin >> N; for(int i = 0; i < N; i++) { cin >> X[i] >> Y[i]; } bool flag = N % 2; int x = X[0] + X[N / 2], y = Y[0] + Y[N / 2]; for(int i = 1; i < N / 2; i++) { flag |= x != X[i...
197
Project_CodeNet
2,013
#define Z(x,i)(x[i]+x[n/2+i]) x[99],y[99],X,Y; n,i;main(){ for(gets(x);~scanf("%d %d",x+n,y+n);n++); if(!(n&1))for(X=Z(x,0),Y=Z(y,0);++i<n/2&&Z(x,i)==X&&Z(y,i)==Y;); printf(i==n/2?"%f %f\n":"NA\n",X/2.0,Y/2.0);exit(0); }
121
Project_CodeNet
2,015
#include<stdio.h> #include<math.h> int N,X[99],Y[99],i,j; double x=0,y=0; #define ll long long double d(int a,int b) { double e,f; return sqrt((e=(double)abs(X[a]-X[b]))*e+(f=(double)abs(Y[a]-Y[b]))*f); } double c(int a) { double l1=d((a-1+N)%N,a); double l2=d(a,(a+1)%N); double l3=d((a-1+N)%N,(a+1)%N); double t...
298
Project_CodeNet
2,017
// AOJ 2442: ConvexCut // 2017.11.17 bal4u@uu #include <stdio.h> #include <string.h> int x[51], y[51]; long long norm(int dx, int dy) { return (long long)dx*dx + (long long)dy*dy; } int parallel(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) { return (long long)(y2-y1)*(long long)(x4-x3) == (long...
376
Project_CodeNet
2,020
from sys import exit EPS = 1e-6 #外積 def OuterProduct(one, two): tmp = one.conjugate() * two return tmp.imag #内積 def InnerProduct(one, two): tmp = one.conjugate() * two return tmp.real #点が線分上にあるか def IsOnSegment(point, begin, end): if abs(OuterProduct(begin-point, end-point)) <= EPS and InnerProduct(begin-point,...
406
Project_CodeNet
2,020
def solve(lis,N): x=(lis[0][0]+lis[N//2][0]) y=(lis[0][1]+lis[N//2][1]) for i in range(1,N//2): if (lis[i][0]+lis[i+N//2][0])!=x or (lis[i][1]+lis[i+N//2][1])!=y: return "NA" return str(x/2)+" "+str(y/2) N=int(input()) if N%2==1: print("NA") else: lis=[] for i in range(N...
153
Project_CodeNet
2,018
N = input() lst = [] for i in range(N): X, Y = map(int, raw_input().split()) lst.append((X, Y)) if N % 2 != 0: print "NA" exit() ansx = lst[0][0] + lst[N / 2][0] ansy = lst[0][1] + lst[N / 2][1] for i in range(N / 2): x = lst[i][0] + lst[i + N / 2][0] y = lst[i][1] + lst[i + N / 2][1] if...
177
Project_CodeNet
2,018
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 eps = 1.0 / 10**13 mod = 10**9+7 dd = [(-1,0),(0,1),(1,0),(0,-1)] ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] def LI(): return [int(x) for x in sys.stdin....
1,425
Project_CodeNet
2,017
n = input() P = set() gx = gy = 0 for i in xrange(n): x, y = map(int, raw_input().split()) P.add((n*x, n*y)) gx += x; gy += y ok = 1 for x, y in P: x += 2*(gx - x) y += 2*(gy - y) if (x, y) not in P: ok = 0 if ok: print "%.08f %.08f" % (gx/float(n), gy/float(n)) else: print "NA"
133
Project_CodeNet
2,017
# coding: utf-8 eps=0.0001 n=int(input()) x_sum=0 y_sum=0 data=[] for i in range(n): x,y=map(int,input().split()) x_sum+=x y_sum+=y data.append((x,y)) x_sum/=n y_sum/=n if n%2!=0: print('NA') exit() for i in range(n//2): if abs(((data[i][0]-x_sum)**2+(data[i][1]-y_sum)**2)**0.5\ -((data...
181
Project_CodeNet
2,016
require 'matrix' ERROR = 1e-5 include Math class Line #ax+by = c (a > 0 or (a == 0 && b > 0)) def self.through_two_points(x1, y1, x2, y2) a = y1 - y2 b = x2 - x1 c = a * x1 + b * y1 new(a, b, c, x1, y1, x2, y2) end def cross_point(l) m = Matrix[ [@a, @b], [l.a, l.b], ]; v = Vector[@c, l.c] ...
536
Project_CodeNet
2,013
import java.io.IOException; import java.util.HashMap; import java.util.Scanner; import java.util.SortedSet; import java.util.TreeSet; public class Main { public static void main(String[] args) throws IOException { Scanner in = new Scanner(System.in); Rule rule = new Rule(); SortedSet<Card> cards = new TreeSet<...
1,141
Project_CodeNet
2,011
import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[][] basePoints = new int[4][13]; int[] rates = new int[9]; ...
1,205
Project_CodeNet
2,011
import java.util.Scanner; //K Poker public class Main{ int suit(char c){ return c=='S'?0:c=='C'?1:c=='H'?2:3; } int num(char c){ return c=='K'?13:c=='Q'?12:c=='J'?11:c=='T'?10:c=='A'?1:c-'0'; } void run(){ Scanner sc = new Scanner(System.in); boolean top = true; while(sc.hasNext()){ if(!top)Syst...
738
Project_CodeNet
2,018
#include <bits/stdc++.h> using namespace std; int n, base[4][13], rate[10]; string mark = "SCHD"; int getNumber(char c) { if (c == 'A') return 0; if (c == 'T') return 9; if (c == 'J') return 10; if (c == 'Q') return 11; if (c == 'K') return 12; return c - '0' - 1; } bool isStraight(string card) { int tmp[5]; ...
759
Project_CodeNet
2,012
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<cassert> #include<iostream> #include<sstream> #include<string> #include<vector> #include<queue> #include<set> #include<map> #include<utility> #include<numeric> #include<algorithm> #include<bitset> #include<complex> #include<stack> using name...
2,104
Project_CodeNet
2,011
#include <iostream> #include <vector> #include <algorithm> using namespace std; int to_i(char c) { switch (c) { case 'A': return 1; case 'T': return 10; case 'J': return 11; case 'Q': return 12; case 'K': return 13; default: return c-'0'; } } void to_ns(int ns[5], const string hand[5]) { ...
1,214