Source stringclasses 1
value | Date int64 2.01k 2.02k | Text stringlengths 22 783k | Token_count int64 20 394k |
|---|---|---|---|
Project_CodeNet | 2,019 | using System;
using System.Linq;
using System.Collections.Generic;
using static System.Math;
static class P
{
static void Main()
{
var n = int.Parse(Console.ReadLine());
var edges = Enumerable.Repeat(0, n - 1).Select(_ => Console.ReadLine().Split().Select(x => int.Parse(x) - 1).ToArray()).ToArr... | 1,595 |
Project_CodeNet | 2,019 | using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
const int mod=(int)1e9+7;
static List<int>[] li;
stati... | 1,152 |
Project_CodeNet | 2,019 | using System;
using System.Collections.Generic;
public class CSharp{
public static void Main(){
Kyopuro chokudai = new Kyopuro();
chokudai.AtCoder();
}
}
public class Kyopuro{
int n, k;
int[] a, b, v, p, ans;
int[] pmin, pmax;
bool yn;
bool[] vtd, odd;
List<int>[] list;
... | 1,078 |
Project_CodeNet | 2,016 | using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.IO;
using Binary = System.Func<System.Linq.Expressions.ParameterExpression, System.Linq.Expressions.ParameterExpression, System.Linq.Expressions.BinaryExpression>;
using Unary = System.Func<System.Linq.Expres... | 3,325 |
Project_CodeNet | 2,016 | using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using Enu = System.Linq.Enumerable;
public class Program
{
static readonly int INF = (int)1e9;
int N, K;
int[][] G;
... | 1,030 |
Project_CodeNet | 2,016 | using System;
using System.Collections.Generic;
class Solve{
int N;
int K;
Vertex[] tree;
public Solve(){}
public static int Main(){
new Solve().Calc();
return 0;
}
void Calc(){
getinput();
if(dfs(tree[0])){
Console.WriteLine("Yes");
df... | 815 |
Project_CodeNet | 2,016 | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading;
using Pair = System.Collections.Generic.KeyValuePair<int, int>;
class Program
{
public Program() { }
static void Main(string[] args)
{
new Program().prog();
}
Scanner cin;
const int ... | 1,702 |
Project_CodeNet | 2,020 | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Kujikatsu029.Algorithms;
using Kujikatsu029.Collections;
using Kujikatsu029.Extensions;
using Kujikatsu029.Numerics;
using Kujikatsu02... | 20,932 |
Project_CodeNet | 2,019 | using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using static Template;
using static System.Console;
using static System.Convert;
using static System.Math;
using Pi = Pair<int, int>;
using Number = System.Int64;
class Solver
{... | 2,165 |
Project_CodeNet | 2,016 | using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
// (づ°ω°)づミe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solver
{
List<int>[] g;
int[] tsize, cind, cpos, csize, cdep, cpar, depth;
int ccnt;
void Dfs1(... | 1,921 |
Project_CodeNet | 2,016 | using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace ARC063E{
public class Program{
//Atcoder Live 解説を参考にしました。
public static void Main(string[] args){
var sr = new StreamReader();
var sw = new StreamWriter(Co... | 1,565 |
Project_CodeNet | 2,012 |
import java.awt.geom.*;
import java.util.*;
import static java.lang.Math.*;
public class Main {
final Scanner sc=new Scanner(System.in);
public static void main(String[] args) {
new Main().init();
}
void init(){
new B();
}
class B{
B(){
while(sc.hasNext()){
int n = sc.nextInt();
Point2D [] pl... | 1,725 |
Project_CodeNet | 2,014 | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
if (n%2==1) {
System.out.println("NA");
return;
}
int[] x = new int[n];
int[] y = new int[n];
for(int i=0;i<n;i++) {
x[i] = sc.nextInt();
y[i] = ... | 230 |
Project_CodeNet | 2,012 | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
// ConvexCut
// 2012/09/19
public class Main{
Scanner sc=new Scanner(System.in);
double EPS=1e-6;
int n;
P[] ps;
void run(){
n... | 1,063 |
Project_CodeNet | 2,012 | import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
public class Main{
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
final int N = sc.nextInt();
Point2D[] points = new Point2D[N]... | 2,071 |
Project_CodeNet | 2,014 | import java.util.Scanner;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
int N = sc.nextInt();
if (N % 2 != 0) {
System.out.println("NA");
return;
}
int[] X = new int[N];
int[] Y = new int[N];
int sx = 0;
int sy = 0;
for (int i = 0; i <... | 279 |
Project_CodeNet | 2,015 |
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
public class Main {
InputStream is;
boolean __FILE_DEBUG_FLAG__ = false;
String __DEBUG_FILE_N... | 2,444 |
Project_CodeNet | 2,018 | import java.util.ArrayList;
import java.util.Scanner;
import java.util.stream.IntStream;
public class Main {
static boolean EQ(double x, double y) {
return Math.abs(x - y) < 1.0e-9;
}
public static void main(String[] args) {
try(Scanner sc = new Scanner(System.in)) {
int n = sc.nextInt();
double[] xs = ne... | 298 |
Project_CodeNet | 2,016 | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(long long i = 0; i < (long long)(n); i++)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define mt make_tuple
template<class T1, class T2> bool chmin(T1 &a, T2 b) { return b < a && (a = b, true); }
templa... | 1,043 |
Project_CodeNet | 2,016 | #include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <fstream>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(... | 392 |
Project_CodeNet | 2,019 | //ConvexCut
#include <iostream>
#include <complex>
#include <cmath>
#include <cstdio>
#include <vector>
#include <tuple>
using namespace std;
typedef complex<double> xy_t;
double dot_product(xy_t a, xy_t b) { return (conj(a) * b).real(); }
double cross_product(xy_t a, xy_t b) { return (conj(a) * b).imag(); }
xy_t proj... | 490 |
Project_CodeNet | 2,014 | #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
... | 434 |
Project_CodeNet | 2,018 | #include <bits/stdc++.h>
using namespace std;
typedef complex<double> P;
int main() {
int N;
cin >> N;
vector<P> points;
for (int i = 0; i < N; i++) {
double x, y;
cin >> x >> y;
points.push_back(P(x,y));
}
P center = P(0,0);
vector<double> sub;
for (int i = 0;... | 215 |
Project_CodeNet | 2,019 | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS)
int main(){
int n; cin>>n;
vector<double> x(n), y(n);
for(int i=0; i<n; i++) cin>>x[i]>>y[i];
vector<double> length;
for(int i=0; i<n; i++){
dou... | 312 |
Project_CodeNet | 2,015 | //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <... | 775 |
Project_CodeNet | 2,014 | #include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cstring>
#include <functional>
#include <cmath>
#include <complex>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define rep1(i,n) for(in... | 710 |
Project_CodeNet | 2,017 | #include <algorithm>
#include <iostream>
#include <vector>
#include <iostream>
#include <cstdio>
#include <complex>
#include <utility>
#define X real()
#define Y imag()
#define EPS (1e-10)
using namespace std;
typedef complex<double> P;
typedef pair<P,P> L;
typedef vector<P> Poly;
namespace std{
bool operator<(const ... | 374 |
Project_CodeNet | 2,016 | #include<bits/stdc++.h>
#define f first
#define s second
#define mp make_pair
#define inf 1000000000
#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);}
... | 464 |
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=(a)-1;i>=b;i--)
#define all(a) (a).begin(),(a).end()
#de... | 973 |
Project_CodeNet | 2,017 | #include <iostream>
#include <cstdio>
#define REP(i, a, n) for(int i = (a); i < (n); i++)
using namespace std;
struct point { int x, y; };
struct line { point p1, p2; };
bool parallel(line l1, line l2) {
int s1 = (l1.p1.y - l1.p2.y) * (l2.p1.x - l2.p2.x);
int s2 = (l1.p1.x - l1.p2.x) * (l2.p1.y - l2.p2.y);
retu... | 427 |
Project_CodeNet | 2,016 | #include<bits/stdc++.h>
#define EPS (1e-7)
#define N 50
using namespace std;
int n,x[N],y[N],flag=1;
double gx,gy;
int main(){
cin>>n;
for(int i=0;i<n;i++){
cin>>x[i]>>y[i];
gx+=x[i]; gy+=y[i];
}
gx/=n; gy/=n;
for(int i=0;i<n;i++){
double px=gx+(gx-x[i]),py=gy+(gy-y[i]);
int f=0;
for(int ... | 197 |
Project_CodeNet | 2,013 | #include <cstdio>
#include <algorithm>
using namespace std;
int main() {
int N; scanf("%d", &N);
int *X = new int[N];
int *Y = new int[N];
for(int i = 0; i < N; i++) {
scanf("%d%d", X+i, Y+i);
}
if(N%2) {
printf("NA\n");
return 0;
}
int x = X[0] + X[N/2];
int y = Y[0] + Y[N/2];
for(int ... | 211 |
Project_CodeNet | 2,020 | #define _CRT_SECURE_NO_WARNINGS
#pragma comment (linker, "/STACK:526000000")
#include "bits/stdc++.h"
using namespace std;
typedef string::const_iterator State;
#define eps 1e-11L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL
#define MOD 998244353LL
#define seg_size 262144 * 4LL
#define pb push_back
#defin... | 466 |
Project_CodeNet | 2,018 | #include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
constexpr double E = 1e-8;
int main() {
int n;
std::vector<std::pair<int, int>> v;
std::pair<int, int> upperLeft(0, 0), bottomRight(0, 0);
std::cin >> n;
for (int i = 0; i < n; i++) {
int x, y; std::cin >> x >> y... | 487 |
Project_CodeNet | 2,015 | #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 Point &p)const{ ret... | 574 |
Project_CodeNet | 2,013 | #include<iostream>
#include<sstream>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<complex>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cassert>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define mp make_pair
#define pb push_back
#define... | 333 |
Project_CodeNet | 2,017 | #include<bits/stdc++.h>
using namespace std;
int main(){
int m;
cin>>m;
if(m%2){
cout<<"NA"<<endl;
return 0;
}
m/=2;
int a[50],a1[50],b[50],b1[50];
for(int i=0;i<m;++i){
cin>>a[i]>>b[i];
}
for(int i=0;i<m;++i){
cin>>a1[i]>>b1[i];
}
int ans1=a[0]+a1[0],ans2=b[0]+b1[0];
for(int i=1;i<m;++i){
if(a[... | 218 |
Project_CodeNet | 2,017 | #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<(const Point &... | 2,961 |
Project_CodeNet | 2,017 | #include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
int a[50],b[50],n;
cin>>n;
double c=0,d=0;
r(i,n){
cin>>a[i]>>b[i];
c+=a[i],d+=b[i];
}
c/=n,d/=n;
if(n%2)goto L;
r(i,n/2)if(!abs((a[i]+a[(i+n/2)%n])/2.0-c)<0.0001||!abs((b[i]+b[(i+n/2)%n]... | 185 |
Project_CodeNet | 2,017 | #include "bits/stdc++.h"
using namespace std;
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2442&lang=jp
// references:http://purple-jwl.hatenablog.com/entry/20121013/1350099039
typedef long long ll;
typedef pair<ll, ll> Point;
int main() {
cin.tie(0); ios::sync_with_stdio(false);
ll N; cin >> N;
vecto... | 517 |
Project_CodeNet | 2,012 | #include <stdio.h>
#include <complex>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef complex<double> P;
#define EPS (1e-9)
inline double dot(const P& a, const P& b) { return real(conj(a)*b); }
inline double cross(const P& a, const P& b) { return imag(conj(a)*b); }
P cros... | 494 |
Project_CodeNet | 2,012 | #include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const dou... | 710 |
Project_CodeNet | 2,019 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> P3;
const ll MOD = 1000000007;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const int MAX_N = int(1e4 + 5);
const double EPS = 1e-8;
const int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define R... | 413 |
Project_CodeNet | 2,012 | #include <iostream>
#include <complex>
#include <vector>
#include <cstdio>
using namespace std;
typedef complex<double> P;
#define EPS (1e-8)
int n;
bool EQ(double a, double b){
if(fabs(a - b) < EPS){
return true;
}
return false;
}
int main(){
while(cin >> n){
vector<P> pol;
for(int i = 0; i <... | 304 |
Project_CodeNet | 2,015 | #include <bits/stdc++.h>
typedef long long LL;
#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
using namespace std;
int main(void)
{
int n;
cin >> n;
vector<int> x,y;
double ansx2,ansy2;
REP(i,n){
int tmp;
cin >> tmp;
x.push_ba... | 293 |
Project_CodeNet | 2,015 | #include <bits/stdc++.h>
using namespace std;
typedef complex<long double> P;
typedef pair<P, P> L;
const long double INF = 1e+9;
const long double EPS = 1e-5;
bool equal(long double a, long double b){ return fabs(a-b) < EPS;}
long double dot(P a, P b){ return real(conj(a)*b); }
long double cross(P a, P b){ return i... | 848 |
Project_CodeNet | 2,016 | #include <bits/stdc++.h>
using namespace std;
#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
typedef complex<double> P;
typedef vector<P> polygon;
double const eps = 1e-7;
polygon poly;
struct line : public vector<P> {
line(P const& a, P const& b) {
push_back(a), push_back(b);
}
... | 707 |
Project_CodeNet | 2,015 | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include... | 2,586 |
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 repr(i,n) for(int i=(int)(n-1);i>=0;i--)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define all(x) (x).begin(),(x).end()
#defi... | 437 |
Project_CodeNet | 2,012 | #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <cstdio>
using namespace std;
typedef long double ld;
struct Point {
ld x, y;
Point(ld x=0, ld y=0) : x(x), y(y) {}
bool operator==(const Point &o) const {
return x == o.x && y == o.y;
}
Point operator+(co... | 411 |
Project_CodeNet | 2,013 | #include <iostream>
#include <complex>
#include <cstdio>
using namespace std;
typedef complex<double> xy_t;
int main() {
int N, x, y;
xy_t P[60];
cin >> N;
for ( int i = 0; i < N; i++ ) {
cin >> x >> y;
P[i] = xy_t( x, y );
}
if ( N % 2 == 0 ) {
xy_t a = ( P[0] + P[N/2] ) * 0.5;
for ( int i = 1... | 228 |
Project_CodeNet | 2,018 | #include <bits/stdc++.h>
using namespace std;
//#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define rept(i,n) rep(i,(n)+1)
#define repst(i,s,n) reps(i,s,(n)+1)
#define reprt(i,n,t) for(int (i)=(n);(i)>=(t);--(i))
#define repr(i,n) reprt(i,n,0)
#define each(itr,... | 1,066 |
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 EPS=1e-10;
double add(double l, double r){
if(abs(l+r)<EPS*(abs(l)+abs(r))) return 0;
return l+r;
}
//l-r は add(l,-r)
//l==r は add(l,-r)==0
struct Pt{
double x, y;
Pt(double xx=0... | 1,002 |
Project_CodeNet | 2,014 | #include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <ctime>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <deque>
#include <complex>
#include <string>
#include <iomanip>... | 3,287 |
Project_CodeNet | 2,015 | #include <iostream>
#include <cstdio>
#include <cassert>
#include <cstring>
#include <vector>
#include <valarray>
#include <array>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <complex>
#include <random>
#include <bitset>... | 345 |
Project_CodeNet | 2,019 | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for... | 1,353 |
Project_CodeNet | 2,017 | #include <iostream>
#include <vector>
#include <iomanip>
#include <cmath>
using namespace std;
constexpr double eps = 1e-10;
int main() {
int N;
cin >> N;
vector<double> x(N), y(N);
for(int i=0; i<N; ++i) {
cin >> x[i] >> y[i];
}
if(N % 2 == 1) {
cout << "NA" << endl;
} els... | 255 |
Project_CodeNet | 2,012 | #include <cstdio>
#include <vector>
#include <complex>
using namespace std;
typedef complex<double> P;
static const double EPS = 1e-8;
bool check(const vector<P>& v, P& ans)
{
int N = v.size();
if (N % 2 != 0) {
return false;
}
N /= 2;
ans = (v[0] + v[N])*0.5;
for (int i = 1; i < N; i++) {
const P ... | 266 |
Project_CodeNet | 2,016 | #include <bits/stdc++.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) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
#define D10 fixed<<setprecision(10)
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<str... | 2,259 |
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... | 1,348 |
Project_CodeNet | 2,016 | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
struct Point{double x,y;};
int main(void){
int N;
bool NA = false;
cin>>N;
vector<Point> p(N);
rep(i,N)cin>>p[i].x>>p[i].y;
NA = N&1;
Point G = {(p[0].x+p[N/2].x)/2.0 ... | 224 |
Project_CodeNet | 2,016 | #include <bits/stdc++.h>
using namespace std;
#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define debug(x) #x << "=" << (x)
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define dump(x)
#endif
typedef long long int ll;
typedef pair<int,int> ... | 1,946 |
Project_CodeNet | 2,013 | #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm> // require sort next_permutation count __gcd reverse etc.
#include <cstdlib> // require abs exit atof atoi
#include <cstdio> // require scanf printf
#include <f... | 8,692 |
Project_CodeNet | 2,015 | #include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-12;
const double PI = acos(-1.0);
inline double SQ(double a){
return a * a;
}
inline bool EQ(double a, double b){
return abs(a - b) < EPS;
}
inline bool LT(double a, double b){
return a - b < -EPS;
}
inline bool LEQ(double a, double b){
return... | 1,194 |
Project_CodeNet | 2,014 | #include <cmath>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;
constexpr long double EPS = 1e-7;
struct point {
long double x, y;
point(long double x = 0.0, long double y = 0.0):x(x), y(y) {}
point(const point &p):x(p.x), y(p.y) {}
point operator+(const point &p) const {
return ... | 941 |
Project_CodeNet | 2,012 | #include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <string>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <cmath>
#include <complex>
#include <ctime>
#include <cstdlib>
using namespace std;
// * XY座標
#define X real()
#define Y imag()
// * 点の表現
typedef comp... | 845 |
Project_CodeNet | 2,016 | #include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;
inline double add(double a, double b){
return abs(a+b)<(1e-10)*(abs(a)+abs(b)) ? 0.0 : a+b;
}
struct vec{
long double x,y;
vec operator-(vec b){
return (vec){add(x,-b.x),add(y,-b.y)};
}
vec ope... | 441 |
Project_CodeNet | 2,014 | #include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int main() {
int n;
cin >> n;
if (n % 2) {
cout << "NA" << endl;
return 0;
}
int... | 230 |
Project_CodeNet | 2,019 | #include <bits/stdc++.h>
using namespace std;
typedef double frac;
const double EPS=1e-10;
double add(double l, double r){
if(abs(l+r)<EPS*(abs(l)+abs(r))) return 0;
return l+r;
}
typedef double frac;
struct Pt{
frac x, y;
Pt(frac xx=0, frac yy=0){x=xx; y=yy;}
Pt& operator=(const Pt &rhs){
... | 944 |
Project_CodeNet | 2,013 | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <stack>
#include <utility>
#include <numeric>
#include <algorithm>
#include <functional>
#include <cctype>
#include <complex>
#include <string>
#include... | 369 |
Project_CodeNet | 2,016 | #include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
typedef complex<double> P;
#define EPS 1e-10
#define PI acos(-1)
bool isParallel(P a, P b)
{
double aa = arg(a);
if (aa < 0) aa = arg(-a);
if (aa < EPS) aa = PI;
double ba = arg(b);
if (ba < 0) ba = arg(-b);
if (ba < EPS) ba ... | 399 |
Project_CodeNet | 2,019 | #include <bits/stdc++.h>
using namespace std;
using CP = complex<long double>;
#define X real()
#define Y imag()
const long double PI = acos(-1);
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
long double ... | 449 |
Project_CodeNet | 2,016 | #include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
... | 325 |
Project_CodeNet | 2,015 | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
scanf("%d",&n);
vector<int> x(n), y(n);
for(int i=0;i<n;i++){
scanf("%d%d",&x[i],&y[i]);
}
if(n%2){
puts("NA");
}else{
set< pair<int,int> > med;
for(int i=0;i<n/2;i++){
med.insert( make_pair( x[i]+x[i+n/2], y[i]+y[i+n... | 183 |
Project_CodeNet | 2,016 | #include<bits/stdc++.h>
using namespace std;
#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v)... | 349 |
Project_CodeNet | 2,020 | #include <iostream>
#ifdef MBP
#include "stdc++.h"
#else
#include <bits/stdc++.h>
#endif
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define REP(i, n) for (long long int i = 0, i##_len = (n); i < i##_len; ++i)
#define REP1(i, n) for (long long int i = 1, i##_len = (n); i <= i##_len; ... | 2,050 |
Project_CodeNet | 2,018 | #include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
using namespace std;
... | 493 |
Project_CodeNet | 2,013 | #include <complex>
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <sstream>
class Point {
public:
Point();
Point(double x_in, double y_in);
Point operator+(const Point& obj);
Point operator-(const Point& obj);
Point operator*(const double n);
Point oper... | 611 |
Project_CodeNet | 2,019 | #include<bits/stdc++.h>
using namespace std;
#define EPS 1e-10
#define equals(a,b) (fabs( (a) - (b) )< EPS )
// c++ 11,14
#define COUNTER_CLOCKWISE 1
#define CLOCKWISE -1
#define ONLINE_BACK 2
#define ONLINE_FRONT -2
#define ON_SEGMENT 0
typedef struct point{
double x,y;
point(){};
point(double x ,double y):x(x),y(... | 2,457 |
Project_CodeNet | 2,020 | #include <bits/stdc++.h>
using namespace std;
#define var auto
using ll = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b)a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b)a=b;}
signed main(){
cin.tie(0);
ios::sync_with_stdio(0);
cout << setprec... | 360 |
Project_CodeNet | 2,019 | #include <iostream>
#include <list>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <algorithm>
#include <cmath>
#include <string>
using namespace std;
int main(){
int N, i;
scanf("%d", &N);
vector<double> X(N), Y(N);
int Xsum = 0, Ysum = 0;
for(i = 0;... | 267 |
Project_CodeNet | 2,019 | #include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
using namespace std;
constexpr long double EPS = 1e-10;
class Point{
public:
long double x,y;
Point(long double x = 0.0, long double y = 0.0): x(x), y(y) {}
Point operator + (const Point &p) const { return Point(x+p.x, y+p.y);... | 577 |
Project_CodeNet | 2,018 | #include <bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
... | 1,743 |
Project_CodeNet | 2,016 | #include <queue>
#include <iostream>
#include <map>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;
#define rep(i,n) for(int i = 0;i < n;i++)
#include <complex>
typedef double D;
typedef complex<D> P;
typedef pair<P, P> L;
typedef vector<P> VP;
#define X real()
#def... | 679 |
Project_CodeNet | 2,012 | #include<cmath>
#include<cstdio>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
const double EPS=1e-8;
int main(){
int n; scanf("%d",&n);
int x[50],y[50];
rep(i,n) scanf("%d%d",x+i,y+i);
if(n%2==1){ puts("NA"); return 0; }
double gx=0,gy=0;
rep(i,n) gx+=x[i], gy+=y[i];
gx/=n;
gy/=n;
rep(i,... | 211 |
Project_CodeNet | 2,013 | #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <c... | 637 |
Project_CodeNet | 2,018 | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld= long double;
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define ALL(v) v.begin(),v.end()
#define EPS 1e-10
int main(){
int n;
cin>>n;
vector<ll> x(n),y(n);
ld sumx=0,sumy=0;
REP(i,n) {
cin>>x[i]>>y[i];
sumx+=x[i];
sumy+=y[i];
}
sumx... | 233 |
Project_CodeNet | 2,019 | #include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#include <tuple>
#include <iomanip>
using namespace std;
typedef long long ll;
int main(void){
int n, x[55], y[55];
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x[i] >> y[i];
x[i] *= 2; y[i] *= 2;... | 487 |
Project_CodeNet | 2,016 | /*include*/
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#include<complex>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define rp(a) while(a--)
#define pb push_back
#de... | 3,271 |
Project_CodeNet | 2,019 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;
templat... | 944 |
Project_CodeNet | 2,016 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typed... | 351 |
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,015 | #include <bits/stdc++.h>
using namespace std;
typedef complex<double> P;
const double eps = 1e-10;
bool equals(double a, double b, double eps = 1e-10) {
return abs(a-b) < eps;
}
double dot(P a, P b) {
return a.real()*b.real() + a.imag()*b.imag();
}
double cross(P a, P b) {
return a.real()*b.imag() - a.i... | 748 |
Project_CodeNet | 2,012 | #include <cstdio>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace ... | 421 |
Project_CodeNet | 2,016 | #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define PI 3.1415926535897932384626433832795028841971
#define INF 100000000
#define EPS 1e-15
#define MOD 1000000007
using namespace std;
int n;
double x[51], y[51];
double ax = 0.0, ay = 0.0;
int main(){
cin >> n;
if(n%2 == 1){
puts("NA");
re... | 293 |
Project_CodeNet | 2,016 | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
//#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
//#include<list>
#include<queue>
#include<deque>
#include<algorithm>
//#include<numeric>
#include<utility>
//#include<memory>
#include<functional>
... | 880 |
Project_CodeNet | 2,018 | #include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0... | 2,970 |
Project_CodeNet | 2,019 | /*
友利奈緒ぱわーでACしてくれ!!!!!!!!!!!!
Charlotteまだ見てない人は見ような!!!!!!!
/ /:/ \:ヽ \
/ / \ ヽ
\__L 彡 ヽ ',
フ / / / / , ヽ ', j
レ / / / ', ヽ j
//... | 2,611 |
Project_CodeNet | 2,017 | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdlib>
using namespace std;
/**************************************************************/
#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS)
#define PI acos(-1)
#define rad(t) double(t)*PI/180.0
// ???
class Poin... | 941 |
Project_CodeNet | 2,016 | #include <stdio.h>
int N, X[50], Y[50], sx, sy;
int main() {
scanf("%d", &N);
for(int i = 0; i < N; i++) {
scanf("%d%d", &X[i], &Y[i]);
sx += X[i];
sy += Y[i];
}
if(N % 2 == 1) printf("NA\n");
else {
bool flag = true;
for(int i = 0; i < N / 2; i++) {
flag = flag && ((1.0 * sx / N - X[i]) * 2 == (X[N /... | 237 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.