| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 72568 | 朱震耀老师 | 导弹拦截问题 | Python3 | Wrong Answer | 33 MS | 3772 KB | 676 | 2024-05-11 10:59:55 |
def intercept_missiles(heights): if not heights: return 0 total_result = [] result = [heights[0]] intercept_count = 1 max_height = heights[0] for height in heights[1:]: if height > max_height: total_result.append(result) result = [height] intercept_count += 1 else: result.append(height) max_height = height total_result.append(result) return total_result, intercept_count def main(): heights = list(map(int, input().split())) r, cnt = intercept_missiles(heights) print(cnt) if __name__ == "__main__": main()
------Input------
123 256 369 213 456 956 23 698 1236 321 500 666
------Answer-----
6
------Your output-----
9