codeforces 719A 【python】

来源:互联网 发布:mysql-5.5.57安装 编辑:程序博客网 时间:2024/05/17 02:17

因为list里的数字都是连续的,所以题目并不难,但要特殊判断结尾的15和0

n = int(raw_input())themoon = map(int,raw_input().split())if len(themoon) == 1:    if themoon[0] == 15:        print "DOWN"    elif themoon[0] ==  0:        print "UP"    else:        print -1else:     a = themoon[-1]    b = themoon[-2]    if a - b > 0:        if a == 15 and b == 14:            print "DOWN"        else:            print "UP"    elif a - b < 0:        if a == 0 and b == 1:            print "UP"        else:            print "DOWN"

原创粉丝点击