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

  1. #include <iostream>
  2. #include <cstdio>
  3. #include <cstdlib>
  4. #include <cstring>
  5. #include <cmath>
  6. #include <cctype>
  7. #include <algorithm>
  8. #include <queue>
  9. #include <deque>
  10. #include <queue>
  11. #include <list>
  12. #include <map>
  13. #include <set>
  14. #include <vector>
  15. #include <utility>
  16. #include <functional>
  17. #include <fstream>
  18. #include <iomanip>
  19. #include <sstream>
  20. #include <numeric>
  21. #include <cassert>
  22. #include <ctime>
  23. #include <iterator>
  24. const int INF = 0x3f3f3f3f;
  25. const int dir[][] = {{-,},{,},{,-},{,},{-,-},{-,},{,-},{,}};
  26. using namespace std;
  27. int main(void)
  28. {
  29. set<int> sadx, sady;
  30. int x[] ,y[] ;
  31. bool flag = true;
  32. for (int i=;i<;++i)
  33. {
  34. scanf("%d%d",&x[i],&y[i]);
  35. sadx.insert(x[i]); sady.insert(y[i]);
  36. for (int j=;j<i;++j)
  37. {
  38. if (x[j]==x[i]&&y[j]==y[i])
  39. {
  40. flag = false;
  41. }
  42. }
  43. }
  44. if(!(sadx.size()==&&sady.size()==)) {
  45. flag = false;
  46. }
  47. int midx, midy; midx=*(++sadx.begin());
  48. midy=*(++sady.begin());
  49. for (int i=;i<;++i)
  50. {
  51. if(midx==x[i]&&midy==y[i])
  52. {
  53. flag=false; break;
  54. }
  55. }
  56. if(flag) printf("respectable\n");
  57. else printf("ugly\n");
  58.  
  59. return ;
  60. }

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

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

codeforces194b的更多相关文章

随机推荐

  1. linux下route命令使用实战

    配置路由表: 第一步: sudo route add -net 172.30.6.0 netmask 255.255.255.0 eth0 执行后可以使用命令route -n查看,查看内容如下: 17 ...

  2. 忙了好一阵,今天随便写篇关于canvas的小东西

    前几天在朋友圈发了几条3D demo视频,其中就有3D空间组成各种图形.如上! 那么这些图形的每个mesh的坐标可不是手动去写,如果你愿意我当然不拦着!所以今天这篇就来介绍如何获得这些图形的坐标数据. ...

  3. redis 数据导出

    一.导出所有的keys echo "keys 201*" |./redis-cli -h localhost -p 6379 -a password >> 1.txt ...

  4. POM.xml 标签详解

    pom作为项目对象模型.通过xml表示maven项目,使用pom.xml来实现.主要描述了项目:包括配置文件:开发者需要遵循的规则,缺陷管理系统,组织和licenses,项目的url,项目的依赖性,以 ...

  5. linux 启动模式

    BLOS-->MBR(master boot record)主引导记录-->引导加载程序-->内核-->init process -->login

  6. webwork

    代码结构,html页面引入两个js文件,work.js和main.js work.js (function () { onmessage = function (e) { var num = e.da ...

  7. spring profile 多环境配置管理

    本地.测试.开发.产品等不同环境文件配置 现象   如果在开发时进行一些数据库测试,希望链接到一个测试的数据库,以避免对开发数据库的影响.   开发时的某些配置比如log4j日志的级别,和生产环境又有 ...

  8. oracle PROCEDURE AS IS区别

    在存储过程(PROCEDURE)和函数(FUNCTION)中没有区别,在视图(VIEW)中只能用 ,在游标(CURSOR)中只能用IS不能用AS.

  9. 并发编程 17—— Lock

    Java并发编程实践 目录 并发编程 01—— ThreadLocal 并发编程 02—— ConcurrentHashMap 并发编程 03—— 阻塞队列和生产者-消费者模式 并发编程 04—— 闭 ...

  10. 递归算法(三)——不借助四则运算实现加法

    问题 求两个整型变量的和,不能使用四则运算,但可以使用位运算. 思路 以二进制形式,考虑两个整数相加: a = 01101001b b = 11100111b s =  ???????? 一个常见的结 ...