观察猜测这个图形是中心对称图形是则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. [APIO2010] 回文串 - 回文自动机

    经典题吧 我觉得我要换个板子,这结构体板子真TM不顺手 #include <bits/stdc++.h> using namespace std; const int N = 2e6 + ...

  2. Selenium3+python自动化009- 多选框

    多选框 # 随机选择多选框# sports=driver.find_elements_by_name("sport")# maxnum=len(sports)# num=rando ...

  3. WebService 之 SoapHeader

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  4. nodejs使用promise实现sleep

    个人博客 地址:http://www.wenhaofan.com/article/20181120180225 let sleep = function (delay) { return new Pr ...

  5. flaskapp

    前置知识 https://blog.csdn.net/u013457794/article/details/88997699?depth_1-utm_source=distribute.pc_rele ...

  6. 第一篇 网站基础知识 第3章 DNS的设置

    第3章 DNS的设置 3.1 DNS解析 3.2 Windows 7设置DNS服务器 3.3Windows设置本机域名和IP的对应关系 在自己的电脑里也可以设置域名和IP的对应关系,具体设置是在C:\ ...

  7. Android 开发 assets和raw

    在Android Project中,有两个文件夹的数据是不会被编译,以原型的方式打包到APK中,这两个文件夹就是 assets 和 res/raw/ 相同点: 1.数据不会编译成二进制字节码. 2.可 ...

  8. java fastjson:Map与json以及JSONObject ,JSONObject与String互转

    import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson ...

  9. vue插槽的使用

    一.插槽的基本使用 二.具名插槽的使用 三.编译作用域的例子 四.作用域插槽 一.插槽的基本使用     1.插槽的基本使用<slot></slot>     2.插槽的默认值 ...

  10. mini-batch是什么 以及dataloader的作用

    mini-batch是什么 以及dataloader的作用 待办 我们在训练神经网络时,使用的是mini-batch(一次输入多张图片),所以我们在使用一个叫DataLoader的工具为我们将5000 ...