Codeforces Round #208 (Div. 2) A.Dima and Continuous Line
- #include <iostream>
- #include <algorithm>
- #include <vector>
- using namespace std;
- int check(int a, int b){
- if(a - b > )return ;
- else if(a-b < ) return -;
- else return ;
- }
- int main(){
- int n;
- cin >> n;
- vector<int> x(n);
- for(int i = ; i < n; ++ i) cin >> x[i];
- int i;
- for( i = ; i < n ; ++ i){
- int j ;
- for(j = ; j < i-; j ++){
- int a = check(x[j],x[i-]);
- int b = check(x[j],x[i]);
- int c = check(x[j+],x[i-]);
- int d = check(x[j+],x[i]);
- if(a*b*c*d < ){
- cout<<"yes"<<endl;
- break;
- }
- }
- if(j < i-) break;
- }
- if(i >= n) cout<<"no"<<endl;
- }
Codeforces Round #208 (Div. 2) A.Dima and Continuous Line的更多相关文章
- Codeforces Round #208 (Div. 2) 358D Dima and Hares
题目链接:http://codeforces.com/problemset/problem/358/D 开始题意理解错,整个就跪了= = 题目大意:从1到n的位置取数,取数的得到值与周围的数有没有取过 ...
- Codeforces Round #208 (Div. 2) B Dima and Text Messages
#include <iostream> #include <algorithm> #include <string> using namespace std; in ...
- Codeforces Round #208 (Div. 2)
A - Dima and Continuous Line 水题:直接模拟: #include<cstdio> #define maxn 1005 using namespace std; ...
- Codeforces Round #167 (Div. 2) D. Dima and Two Sequences 排列组合
题目链接: http://codeforces.com/problemset/problem/272/D D. Dima and Two Sequences time limit per test2 ...
- Codeforces Round #324 (Div. 2) D. Dima and Lisa 哥德巴赫猜想
D. Dima and Lisa Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/584/probl ...
- Codeforces Round #214 (Div. 2) C. Dima and Salad (背包变形)
C. Dima and Salad time limit per test 1 second memory limit per test 256 megabytes input standard in ...
- Codeforces Round #214 (Div. 2) C. Dima and Salad 背包
C. Dima and Salad Dima, Inna and Seryozha have gathered in a room. That's right, someone's got to ...
- Codeforces Round #324 (Div. 2)D. Dima and Lisa 数学(素数)
D. Dima and Lisa Dima loves representing an odd num ...
- Codeforces Round #553 (Div. 2)B. Dima and a Bad XOR 思维构造+异或警告
题意: 给出一个矩阵n(<=500)*m(<=500)每一行任选一个数 异或在一起 求一个 异或在一起不为0 的每行的取值列号 思路: 异或的性质 交换律 x1^x2^x3==x3^x2 ...
随机推荐
- VS2010调用Com组件
Com组件开发过程中用的不多,资料也不多,故记录开发Com组件中的部分问题. 在这一篇文章里,讲解了如何使用VS2010创建Com组件.现在基于该文章创建的Com组件接口,创建VC++项目来调用该接口 ...
- GDB 使用大法
一.GDB 我用的是 GCC+POWERSHELL+GDB, GDB刚刚接触也有很多要记的. 二.一个调试示例 tst.c #include <stdio.h> int func(int ...
- Linux LAMP环境搭建
什么是LAMP Linux+Apache+Mysql/MariaDB+Perl/PHP/Python一组常用来搭建动态网站或者服务器的开源软件,本身都是各自独立的程序,但是因为常被放在一起使用,拥有了 ...
- linux dd命令实用详解
linux dd命令刻录启动U盘详解 dd命令做usb启动盘十分方便,只须:sudo dd if=xxx.iso of=/dev/sdb bs=1M 用以上命令前必须卸载u盘,sdb是你的u盘,bs= ...
- 什么是iis服务器
IS 是Internet Information Server的缩写,它是微软公司主推的服务器,最新的版本是Windows2003里面包含的IIS 6.0,IIS与WindowNT Server完全集 ...
- Android 中“TabBar”的背景拉伸问题
在最近的一个工程中,要求有一个在上方了tabbar,上面有并排的3个方形按钮,每个按钮都有背景图.问题来了,如何让图片在不同尺寸的屏幕上不失真呢?(由于我们的项目比较小,工时很短,不能为每一个屏幕尺寸 ...
- Linux下安装firefox最新版
Linux刚安装好的时候,默认是火狐浏览器并且版本比较低,我的系统是CentOS,火狐版本号才31,用yum安装的话版本也不是最新,只要从官方网站下载最新版安装就可以了,方法如下: 首先去火狐主页,中 ...
- ubuntu 下wireshark 软件安装与使用
在ubuntu下,使用wireshark也是很有必要的.虽然可以使用tcpdump等工具. ubuntu:11.10 1. sudo apt-get install wireshark ...
- AngularJS学习笔记1
简介 AngularJS 是一个为动态WEB应用设计的结构框架,提供给大家一种新的开发应用方式,这种方式可以让你扩展HTML的语法,以弥补在构建动态WEB应用时静态文本的不足,从而在web应用程序中使 ...
- C语言中的break、continue和goto三者的区别与用法
exit的话是在stdlib的头文件里面定义的,他是的程序退出,正如exit的字面意思一样break的话是终止当前循环继续进行循环后面的语句,但是程序照样还在进行只能while switch for中 ...