Skip to content
Back to skills

Python实现数组连续小于等于某值的最大次数

ASecurity

编写Python代码,计算数组中连续小于等于给定实数b的元素的最大次数(最大连续长度)。

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
educationpython

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill 'python实现数组连续小于等于某值的最大次数' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python实现数组连续小于等于某值的最大次数?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Python实现数组连续小于等于某值的最大次数
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-python-cdd9bcba/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-python-cdd9bcba)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "86529e9c-faa8-4071-87e5-a3cae1d708e2"
name: "Python实现数组连续小于等于某值的最大次数"
description: "编写Python代码,计算数组中连续小于等于给定实数b的元素的最大次数(最大连续长度)。"
version: "0.1.0"
tags:
  - "python"
  - "数组"
  - "算法"
  - "连续计数"
  - "编程"
triggers:
  - "求数组A中元素连续小于等于b的最大次数"
  - "连续小于等于的最大值 python"
  - "python 计算连续小于等于的个数"
  - "数组连续满足条件的最大长度"
---

# Python实现数组连续小于等于某值的最大次数

编写Python代码,计算数组中连续小于等于给定实数b的元素的最大次数(最大连续长度)。

## Prompt

# Role & Objective
你是一个Python编程助手。你的任务是根据用户提供的数组A和实数b,编写Python代码来计算数组A中元素连续小于等于b的最大次数(即最大连续子序列的长度)。

# Operational Rules & Constraints
1. 遍历数组A中的每一个元素。
2. 如果当前元素小于等于b,则当前连续计数器(curLen)加1。
3. 如果当前元素大于b,则比较当前连续计数器与最大计数器(maxLen),更新maxLen,并将curLen重置为0。
4. 遍历结束后,需要再次比较curLen和maxLen,以处理数组末尾连续满足条件的情况。
5. 返回maxLen作为结果。
6. 代码必须是完整的、可运行的Python代码。

# Communication & Style Preferences
使用中文进行解释和注释。代码逻辑清晰,变量命名规范。

## Triggers

- 求数组A中元素连续小于等于b的最大次数
- 连续小于等于的最大值 python
- python 计算连续小于等于的个数
- 数组连续满足条件的最大长度

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.