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"
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
- codeforces 675 A~E(Round #353 Div. 2) python and C++ 解法
- codeforces 651A python
- 【32.89%】【codeforces 719A】Vitya in the Countryside
- python codeforces 322 div2 C
- Python解决codeforces ---- 1
- codeforces_734C python的sort()函数 python的bisect
- 【codeforces - 909C - Python Indentation】DP
- python爬虫抓取codeforces分数
- codeforces 570A【python】
- codeforces 151A【python】
- Python解决codeforces ---- 1
- codeforces 560A【python】
- Python解决codeforces ---- 5
- Codeforces-688B Lovely Palindromes和Codeforces-630A-Again Twenty Five!(两道傻X题,借此秀一下python的简洁)
- Python解决codeforces ---- 2
- python中的eval()+codeforces--116A.Tram
- 题解-python-CodeForces 227A
- Review of Codeforces 5A and 5B(Python)
- python爬虫学习(5) —— 扒一下codeforces题面