题意:根据题目,给定一些数字,让你判断是上升还是下降。

析:注意只有0,15时特别注意一下,然后就是14 15 1 0注意一下就可以了。

代码如下:

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <cstdio>
#include <string>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cstring>
#include <set>
#include <queue>
#include <algorithm>
#include <vector>
#include <map>
#include <cctype>
#include <cmath>
#include <stack>
#include <tr1/unordered_map>
#define freopenr freopen("in.txt", "r", stdin)
#define freopenw freopen("out.txt", "w", stdout)
using namespace std;
using namespace std :: tr1; typedef long long LL;
typedef pair<int, int> P;
const int INF = 0x3f3f3f3f;
const double inf = 0x3f3f3f3f3f3f;
const LL LNF = 0x3f3f3f3f3f3f;
const double PI = acos(-1.0);
const double eps = 1e-8;
const int maxn = 1e3 + 5;
const int mod = 1e9 + 7;
const int N = 1e6 + 5;
const int dr[] = {-1, 0, 1, 0, 1, 1, -1, -1};
const int dc[] = {0, 1, 0, -1, 1, -1, 1, -1};
const char *Hex[] = {"0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111", "1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111"};
inline LL gcd(LL a, LL b){ return b == 0 ? a : gcd(b, a%b); }
int n, m;
const int mon[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int monn[] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
inline int Min(int a, int b){ return a < b ? a : b; }
inline int Max(int a, int b){ return a > b ? a : b; }
inline LL Min(LL a, LL b){ return a < b ? a : b; }
inline LL Max(LL a, LL b){ return a > b ? a : b; }
inline bool is_in(int r, int c){
return r >= 0 && r < n && c >= 0 && c < m;
}
int a[100]; int main(){
while(scanf("%d", &n) == 1){
for(int i = 0; i < n; ++i) scanf("%d", a+i);
if(n == 1 && a[0] != 15 && a[0] != 0){ printf("-1\n"); continue; }
else if(n == 1 && a[0] == 15){ printf("DOWN\n"); continue; }
else if(n == 1 && a[0] == 0){ printf("UP\n"); continue; }
if(a[n-1] == 15 && a[n-2] == 14) printf("DOWN\n");
else if(a[n-1] == 0 && a[n-2] == 1) printf("UP\n");
else if(a[n-1] > a[n-2]) printf("UP\n");
else printf("DOWN\n"); }
return 0;
}

CodeForces 719A Vitya in the Countryside (水题)的更多相关文章

  1. CodeForces 719A Vitya in the Countryside 思维题

    题目大意:月亮从0到15,15下面是0.循环往复.给出n个数字,如果下一个数字大于第n个数字输出UP,小于输出DOWN,无法确定输出-1. 题目思路:给出0则一定是UP,给出15一定是DOWN,给出其 ...

  2. Codeforces Round #373 (Div. 2) A. Vitya in the Countryside 水题

    A. Vitya in the Countryside 题目连接: http://codeforces.com/contest/719/problem/A Description Every summ ...

  3. codeforces 719A Vitya in the Countryside(序列判断趋势)

    题目链接:http://codeforces.com/problemset/problem/719/A 题目大意: 题目给出了一个序列趋势 0 .1 .2 .3 ---14 .15 .14 ----3 ...

  4. CodeForces 719A. Vitya in the Countryside

    链接:[http://codeforces.com/group/1EzrFFyOc0/contest/719/problem/A] 题意: 给你一个数列(0, 1, 2, 3, 4, 5, 6, 7, ...

  5. Code forces 719A Vitya in the Countryside

    A. Vitya in the Countryside time limit per test:1 second memory limit per test:256 megabytes input:s ...

  6. Educational Codeforces Round 7 B. The Time 水题

    B. The Time 题目连接: http://www.codeforces.com/contest/622/problem/B Description You are given the curr ...

  7. Educational Codeforces Round 7 A. Infinite Sequence 水题

    A. Infinite Sequence 题目连接: http://www.codeforces.com/contest/622/problem/A Description Consider the ...

  8. Codeforces Testing Round #12 A. Divisibility 水题

    A. Divisibility Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/597/probl ...

  9. Codeforces Beta Round #37 A. Towers 水题

    A. Towers 题目连接: http://www.codeforces.com/contest/37/problem/A Description Little Vasya has received ...

随机推荐

  1. cocos2d-x-3.6 引擎概述

    cocos2d-x是一个游戏开发引擎,从公布到如今也有五六年了,一路看它慢慢壮大.它是如今应用最多的开源2d引擎,没有之中的一个,据说已经占据90%的市场,所以.对于想从事游戏开发的童鞋来说还是有必要 ...

  2. 全志a13开发总结

    这几天因为工作的原因,開始接触全志a13芯片,本人在网上搜集了好长时间,可是网上的资料对这方面的描写叙述是很少的, 所以,仅仅能靠数据手冊还有官网上面的英文文档进行开发了,下面仅仅是开发中的非常少的一 ...

  3. svn 创建分支、切换分支 及 合并分支 操作

    关联远程仓库: 右键  ---  点击 ' SVN Checkout...' 生成 打开trunk目录,在trunk目录下新建两个文本文件A.java,B.java: 打开A.java输入以下内容: ...

  4. 标准代码书写 C++ 的string类的用法总结

    相信使用过MFC编程的朋友对CString这个类的印象应该非常深刻吧?的确,MFC中的CString类使用起来真的非常的方便好用.但是如果 离开了MFC框架,还有没有这样使用起来非常方便的类呢?答案是 ...

  5. mvc4中 @Url.Action 如何读取javascript变量的值

    js中  function Search()  {     var businessDate = GetSelectedBusinessDate("#businessYear",  ...

  6. [转]XCode中修改缺省公司名称/开发人员名称

    本文转载至  http://www.cnblogs.com/zhulin/archive/2011/11/24/2261537.html   XCode新建文件后,头部会有开发人员名称,公司名称等信息 ...

  7. Tomcat 安装与配置规范

    Tomcat 安装 演示版本:8.5.32 安装版 JDK推荐版本:jdk1.8 下载地址:https://tomcat.apache.org/download-80.cgi 安装教程 注意:tomc ...

  8. ZOJ 3874 Permutation Graph 分治NTT

    Permutation Graph Time Limit: 2 Seconds      Memory Limit: 65536 KB Edward has a permutation {a1, a2 ...

  9. Micro Frontends

    Micro Frontends - extending the microservice idea to frontend development https://micro-frontends.or ...

  10. what's WSDL

    WSDL (Web Services Description Language,Web服务描述语言) 它是一种XML Application,他将Web服务描述定义为一组服务访问点,客户端可以通过这些 ...