观察猜测这个图形是中心对称图形是则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. springBoot 发送邮件图片不显示

    解决方案 MimeMessageHelper 的执行顺序错了,先执行 setText() 然后执行 addInline() 添加图片 <img src="cid:p03"/& ...

  2. Eclipse创建JSP、HTML、CSS文件默认字符集设置成UTF-8

    问题:在使用eclipse的时候总是发现新创建的JSP文件.HTML文件等默认总是ISO-8859-1,每次都要修改成自己使用的utf-8的,很是麻烦,因此在网上查看了一下发现是可以修改字符集的默认值 ...

  3. Mesh R-CNN 论文翻译(实验部分)

    本文为 Mesh R-CNN 论文翻译(原理部分)的后续.Mesh R-CNN 原论文. 4 实验   我们在ShapeNet上对网格预测分支进行基准测试,并与最先进的方法相比较.然后,我们在野生的有 ...

  4. AntDesign(React)学习-13 Warning XX should not be prefixed with namespace XXX

    有篇UMI入门简易教程可以看看:https://www.yuque.com/umijs/umi/hello 程序在点击操作时报了一个Warning: [sagaEffects.put] User/up ...

  5. Java 在程序中输入输出

    本周主要学习了Java如何在程序中进行输入和输出,主要分为以下三种: 一.文本界面的输入与输出 1. 使用 javva.util.Scanner 类 2. 使用 in 及 out 二.图形界面的输入与 ...

  6. 2.restEasy中@PathParam和@QueryParam的区别

    例如代码: @GET @Path("/{id}") @Produces(MediaType.APPLICATION_JSON) public T query(@PathParam( ...

  7. win10中批量新建文件夹

    1.新建一个bat文件,如[批量新建.bat].或者新建txt文件,输入完内容后重命名为bat文件 2.建议用notepad软件打开文件,首先确定编码格式为ANSI编码 (否则最后出现的效果是乱码,不 ...

  8. 【Python】文本进度条

    1.0代码: import time#引入time库 scale=10#文本进度条宽度 print("------执行开始------") for i in range(scale ...

  9. 安卓模拟器genymotion 安装使用

    下载:https://www.genymotion.com/download/ 安装前先注册: https://www.runoob.com/w3cnote/android-tutorial-geny ...

  10. CBE引擎概览

    摘录于CBE官方文档:https://www.comblockengine.com/docs/1.0/overview/index/ 架构图总览: Switch Fabric:交换机网络,根据网络环境 ...