观察猜测这个图形是中心对称图形是则YES,否则NO

 #define HAVE_STRUCT_TIMESPEC
#include<bits/stdc++.h>
using namespace std;
pair<long long,long long>pr[];
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin>>n;
for(int i=;i<=n;++i){
cin>>pr[i].first>>pr[i].second;
pr[i].first=*pr[i].first;
pr[i].second=*pr[i].second;
}
if(n%==){//奇数点旋转180°一定不对称
cout<<"NO";
return ;
}
pair<long long,long long>temp=make_pair((pr[+n/].first+pr[].first)/,(pr[+n/].second+pr[].second)/);//找到重心
for(int i=;i<=n/;++i){
pair<long long,long long>res=make_pair((pr[i+n/].first+pr[i].first)/,(pr[i+n/].second+pr[i].second)/);
if(temp.first!=res.first||temp.second!=res.second){//如果重心不在一个点,则不是中心对称图形
cout<<"NO";
return ;
}
}
cout<<"YES";
return ;
}

Codeforces Round #618 (Div. 1)B(几何,观察规律)的更多相关文章

  1. Codeforces Round #618 (Div. 1)A(观察规律)

    实际上函数值为x&(-y) 答案仅和第一个数字放谁有关 #define HAVE_STRUCT_TIMESPEC #include <bits/stdc++.h> using na ...

  2. Codeforces Round #618 (Div. 2)

    题库链接 https://codeforces.ml/contest/1300 A. Non-zero 一个数组,每次操作可以给某个数加1,让这个数组的积和和不为0的最小操作数 显然如果有0的话,必须 ...

  3. [CF百场计划]#2 Codeforces Round #618 (Div. 2)

    A. Non-zero Description: Guy-Manuel and Thomas have an array \(a\) of \(n\) integers [\(a_1, a_2, \d ...

  4. Codeforces Round #618 (Div. 1)C(贪心)

    把所有数看作N块,后面的块比前面的块小的话就合并,这个过程可能会有很多次,因为后面合并后会把前面的块均摊地更小,可能会影响更前面地块,像是多米诺骨牌效应,从后向前推 #define HAVE_STRU ...

  5. Codeforces Round #618 (Div. 2)A. Non-zero

    Guy-Manuel and Thomas have an array aa of nn integers [a1,a2,…,an ]. In one step they can add 11 to ...

  6. Codeforces Round #618 (Div. 2)C. Anu Has a Function

    Anu has created her own function ff : f(x,y)=(x|y)−y where || denotes the bitwise OR operation. For ...

  7. Codeforces Round #618 (Div. 2) 小号上紫之路

    这一场涨了不少,题也比较偏思维,正好适合我 A. Non-zero 我们记录这些数字的总和sum,并且记录0的个数zero,显然答案应该是这些0的个数,注意如果sum+zero==0的话答案要额外加一 ...

  8. Codeforces Round #618 (Div. 2)-B. Assigning to Classes

    Reminder: the median of the array [a1,a2,-,a2k+1] of odd number of elements is defined as follows: l ...

  9. Codeforces Round #618 (Div. 2)-Non-zero

    Guy-Manuel and Thomas have an array a of n integers [a1,a2,-,an]. In one step they can add 1 to any ...

随机推荐

  1. Hadoop 集群ssh免密登录设置

    0.安装命令: yum list installed | grep openssh-server 命令检查ssh安装有没有安装,如果查询出来有就表示安装了,否则反之 通过 yum install op ...

  2. java 学习(day2) 时钟类

    看过python的面向对象,所以入手java总的来说还是比较快的. 看视频学习之后写了一个简单的时钟 一个时钟有两部分组成小时和分钟.再大一些还有月,日. 分析一下就是,上述这些属性到达一个值之后,就 ...

  3. AntDesign(React)学习-10 Dva 与后台数据交互

    明天正式在线办公没时间学习了,今天晚上再更新一篇, 代码提交一次:https://github.com/zhaogaojian/jgdemo 1.src下创建services目录 创建文件userSr ...

  4. format的使用

    v="敬爱可亲的{0},最喜欢在{1}地方干{2}" name1=input("名字>") lang=input("地点>") ...

  5. 支持CSS3的高级CSS

    一.匹配部分字符串 在CSS2中,可以使用[ href='info.htm' ] 这样的属性选择器来匹配href属性中的字符,但是无法只匹配部分字符串.而CSS3给出了三个新的运算符:^ , $ 和 ...

  6. [Java IO]05_JSON操作

    目录 6.1 JSON 知识背景  6.1.1 JSON 简介  6.1.2 JSON 语法  6.1.3 JSON 的数据结构6.2 Java 中操作 JSON 数据  6.2.1 Jar包下载   ...

  7. mybatis(五):源码分析 - sqlsource创建流程

  8. import 与 from...import

  9. OrCAD 仿真与仿真模块库介绍

    PSpice A/D9.1个别时候可能会出现异常现象,例如:某一步后,突然电路图的电源极性被自动改变了!造成直流电压和直流电流不正常,输出无波形.所以应该趁正常的时候做好备份是明智的. PSpice ...

  10. python 3.8 下安装 tensorflow 1.14

    pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.14.0-py3-none-a ...