码迷,mamicode.com
首页 > 其他好文 > 详细

CF-55 C.Pie or die

时间:2019-10-24 21:55:18      阅读:63      评论:0      收藏:0      [点我收藏+]

标签:std   问题   技术   ring   image   mes   include   amp   ima   

技术图片

做法:先把四个角分别覆盖一条边,于是问题转化为判断离边最近的一个点是否离边的距离大于等于4

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int n,m,k,x,y;
int main(){
    scanf("%d%d%d",&n,&m,&k);
    for(int i=1;i<=k;i++){
        scanf("%d%d",&x,&y);
        if(x<=5||n-x<=4||y<=5||m-y<=4){
            puts("YES");
            return 0;
        }
    }
    puts("NO");
    return 0;
}

 

CF-55 C.Pie or die

标签:std   问题   技术   ring   image   mes   include   amp   ima   

原文地址:https://www.cnblogs.com/thmyl/p/11734722.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!