link:http://codeforces.com/problemset/problem/334/B

 #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <algorithm>
#include <queue>
#include <deque>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <functional>
#include <fstream>
#include <iomanip>
#include <sstream>
#include <numeric>
#include <cassert>
#include <ctime>
#include <iterator>
const int INF = 0x3f3f3f3f;
const int dir[][] = {{-,},{,},{,-},{,},{-,-},{-,},{,-},{,}};
using namespace std;
int main(void)
{
set<int> sadx, sady;
int x[] ,y[] ;
bool flag = true;
for (int i=;i<;++i)
{
scanf("%d%d",&x[i],&y[i]);
sadx.insert(x[i]); sady.insert(y[i]);
for (int j=;j<i;++j)
{
if (x[j]==x[i]&&y[j]==y[i])
{
flag = false;
}
}
}
if(!(sadx.size()==&&sady.size()==)) {
flag = false;
}
int midx, midy; midx=*(++sadx.begin());
midy=*(++sady.begin());
for (int i=;i<;++i)
{
if(midx==x[i]&&midy==y[i])
{
flag=false; break;
}
}
if(flag) printf("respectable\n");
else printf("ugly\n"); return ;
}

关键就是思路清晰,想清楚。

首先,8个点不能有相同的,然后,横纵坐标必须都是3个不同的数字。然后要找到中间的点,一定是不存在的,若存在就不符合。

codeforces194b的更多相关文章

随机推荐

  1. Redis - 发布和订阅

    一.概述 1). 发布和订阅是一种消息通信模式. 2). 优点:使消息订阅者和消息发布者耦合度降低,类似设计模式中的观察者模式. 二.发布和订阅 订阅命令: // 订阅一个或多个频道 // 返回值:v ...

  2. JS事件委托学习(转)

    JS 事件委托就是利用冒泡原理,把事件加到父级上触发,执行效果. 好处: 1.提高性能 2.新添加的元素还会有之前的事件     <</</</</li></ ...

  3. openstack Icehouse发布

    OpenStack 2014.1 (Icehouse) Release Notes General Upgrade Notes Windows packagers should use pbr 0.8 ...

  4. Oracle_双机备份

    1.dataguard http://jingyan.baidu.com/article/f96699bb956ef2894e3c1b39.html http://blog.itpub.net/262 ...

  5. Android 检查手机网络是否可用

    添加网络状态权限 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> 代 ...

  6. PHP 小方法之 算生日

    if (! function_exists ( 'diff_date' )) { function diff_date($date1, $date2){ $datestart = date ( 'Y- ...

  7. MVP -----个人理解与示例(android例子 实现)

    MVP 也就是Model View Presenter模式,是建立一个工程的一种模式. ======================================================== ...

  8. WPF:换肤

    看了一篇博客,觉得样式很好看,就自己动手做了一下,做个总结. 效果:    选择不同的图片背景就会改变: 直接上代码: 每个Theme对应一张图,除了图的名称不同之外,Theme?.xaml中的内容相 ...

  9. windows docker测试

    最近测试环节要求比较多,笔记本上虚拟机越来越多,试验一下docker,随笔如下. 一.安装docker 主机windows 10 专业版 网上在windows10上安装docker有两种方法 一个是使 ...

  10. loading

    <!doctype html> <html> <head> <title>实惠福利</title> <meta charset=&qu ...