您的位置:首页 > 编程语言 > Python开发

codeforces 719A 【python】

2017-10-18 22:48 573 查看
因为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 -1
else:
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"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  codeforces python