codeforces194b
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的更多相关文章
随机推荐
- linux下route命令使用实战
配置路由表: 第一步: sudo route add -net 172.30.6.0 netmask 255.255.255.0 eth0 执行后可以使用命令route -n查看,查看内容如下: 17 ...
- 忙了好一阵,今天随便写篇关于canvas的小东西
前几天在朋友圈发了几条3D demo视频,其中就有3D空间组成各种图形.如上! 那么这些图形的每个mesh的坐标可不是手动去写,如果你愿意我当然不拦着!所以今天这篇就来介绍如何获得这些图形的坐标数据. ...
- redis 数据导出
一.导出所有的keys echo "keys 201*" |./redis-cli -h localhost -p 6379 -a password >> 1.txt ...
- POM.xml 标签详解
pom作为项目对象模型.通过xml表示maven项目,使用pom.xml来实现.主要描述了项目:包括配置文件:开发者需要遵循的规则,缺陷管理系统,组织和licenses,项目的url,项目的依赖性,以 ...
- linux 启动模式
BLOS-->MBR(master boot record)主引导记录-->引导加载程序-->内核-->init process -->login
- webwork
代码结构,html页面引入两个js文件,work.js和main.js work.js (function () { onmessage = function (e) { var num = e.da ...
- spring profile 多环境配置管理
本地.测试.开发.产品等不同环境文件配置 现象 如果在开发时进行一些数据库测试,希望链接到一个测试的数据库,以避免对开发数据库的影响. 开发时的某些配置比如log4j日志的级别,和生产环境又有 ...
- oracle PROCEDURE AS IS区别
在存储过程(PROCEDURE)和函数(FUNCTION)中没有区别,在视图(VIEW)中只能用 ,在游标(CURSOR)中只能用IS不能用AS.
- 并发编程 17—— Lock
Java并发编程实践 目录 并发编程 01—— ThreadLocal 并发编程 02—— ConcurrentHashMap 并发编程 03—— 阻塞队列和生产者-消费者模式 并发编程 04—— 闭 ...
- 递归算法(三)——不借助四则运算实现加法
问题 求两个整型变量的和,不能使用四则运算,但可以使用位运算. 思路 以二进制形式,考虑两个整数相加: a = 01101001b b = 11100111b s = ???????? 一个常见的结 ...