标签:
1 def main(): 2 t = int(raw_input()) 3 for _ in range(t): 4 n, k = map(int, raw_input().strip().split(‘ ‘)) 5 lateNum = 0 6 stuArrialTime = map(int, raw_input().strip().split(‘ ‘)) 7 for i in stuArrialTime: 8 if i > 0: 9 lateNum += 1 10 if lateNum > (n - k): 11 print "YES" 12 else: 13 print "NO" 14 15 16 main()
Link:
https://www.hackerrank.com/challenges/angry-professor
错误
sublime使用的时候,注意缩进,python对这个很敏感
学习
更加流畅的代码思路和逻辑思维
标签:
原文地址:http://www.cnblogs.com/sangocare/p/4490714.html