中级
实现CPU持续过热告警检测
未完成
中级参考
代码结构已给出,请填写 ____ 处
def solve():
from pyodide.http import open_url
from io import StringIO
import pandas as pd
hb_csv = open_url(____).read()
hb = pd.read_csv(StringIO(____))
THRESHOLD = ____; CONSEC = ____
def check(____):
rows = df[df['____']==sid].sort_values(____)
temps = list(____)
max_c = ____; cur = ____
for t in temps:
cur = cur+____ if t > THRESHOLD else ____
max_c = max(____)
return max_c >= CONSEC, max_c, max(____) if temps else ____
alerts = []
for sid in list(hb['____'].unique())[:____]:
is_alert, max_c, max_t = check(____)
if is_alert:
alerts.append({'____':sid,'____':max_c,'____':round(____)})
print("____"+str(____)+"____"+str(____)+"____")
for a in alerts[:____]:
print("____"+a['____']+"____"+str(____)+"____"+str(____)+"____")
print("____"+str(len(____)))
示例
输入
solve()
期望输出
Overheat alerts (>75.0C for 3 consecutive): Total: 0
👑
升级 VIP
解锁全部题目,畅通无阻地学习
- ✓ 解锁全部训练包所有题目
- ✓ 查看完整参考代码和提示
- ✓ 浏览器内直接运行 Python 代码
- ✓ 自动批改 + 进度追踪
30天
¥18
1年
¥99
2年
¥158
3年
¥199