Angry Professor

 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对这个很敏感

学习

  更加流畅的代码思路和逻辑思维

时间: 2024-08-27 07:46:28

Angry Professor的相关文章

Problem 1567 - D - Sloth's Angry ( 递归+贪心)

Problem 1567 - D - Sloth's Angry Time Limit: 1000MS Memory Limit: 65536KB Total Submit: 326 Accepted: 113 Special Judge: No Description A forest is full of sloths, they are so eager for tree leaves and as a result, very angry. We assume that the fore

bzoj4509【Usaco2016 Jan】Angry Cows

4509: [Usaco2016 Jan]Angry Cows Time Limit: 10 Sec  Memory Limit: 128 MB Submit: 83  Solved: 38 [Submit][Status][Discuss] Description Bessie the cow has designed what she thinks will be the next big hit video game: "Angry Cows". The premise, whi

Crazy Professor

Crazy Professor Time limit: 1.0 secondMemory limit: 64 MB Professor Nathan Mathan is crazy about mathematics. For an unknown reason, he started to write on the blackboard all positive integers starting from 1. After writing a new number a, Professor

[听课笔记]Professor Michael Cusumano's New Book:" Strategy Rules: Five Timeless Lessons from Bill Gates, Andy Grove, and Steve Jobs"

1. Look Forward, Reason Back Extrapolate, interpret, then tie vision to concrete actions2. Make Big bets, Without Betting the Company Bold and ambitious to change the game, but not reckless3. Build Platforms & Ecosystems, Not Just Products No firm is

2015微软实习在线笔试题 - Professor Q's Software

时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Professor Q develops a new software. The software consists of N modules which are numbered from 1 to N. The i-th module will be started up by signal Si. If signal Si is generated multiple times, the i-th module

angry ip scanner

Angry IP Scanner ist eine freie Software für die Suche von Netzwerkteilnehmern und für Portscans. Angry IP Scanner kann in Sicherheitsprüfungen von Firmennetzwerken Verwendung finden.[1] Die Software sucht in einem vorher spezifizierten IP-Bereich na

微软线上笔试-2015-4-3(1,2题) Magic Box && Professor Q's Software

写在前面: http://blog.csdn.net/michael_kong_nju/article/details/44872519 关于4.3号的微软线上挑战赛,感觉自己还是刷题刷少了,表现在几个方面:1. 编程经验不足.2. 算法的使用不灵活.所以下面还是要加强OJ的训练, 把Leetcode上的题多做做.后面又把4道题仔细的编写调试了一下,希望和我情况类似的同学也能加紧代码的训练. 1. 第一题的原题是: The circus clown Sunny has a magic box.

codeforces 620D D. Professor GukiZ and Two Arrays

D. Professor GukiZ and Two Arrays Professor GukiZ has two arrays of integers, a and b. Professor wants to make the sum of the elements in the array a sa as close as possible to the sum of the elements in the array b sb. So he wants to minimize the va

HDU 4649 Professor Tian (概率DP)

Professor Tian Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 870    Accepted Submission(s): 479 Problem Description Timer took the Probability and Mathematical Statistics course in the 2012, B